Merge pull request #237 in TEA/mina-sidor-fa-web from feature/pr-view to next

Squashed commit of the following:

commit b5d578ec60b145021ccad3e6d3ff2974252802e6
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Mon Nov 1 11:56:50 2021 +0100

    Added period to PR view
This commit is contained in:
Erik Tiekstra
2021-11-01 13:29:29 +01:00
parent bdc526ce24
commit 596033f08a
5 changed files with 19 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
import { DateFormatOptions } from '@msfa-models/date-format-options.model';
export function formatToDate(date: string): Date {
date = date.replace(/-/g, '');
const year = date.substring(0, 4);
const month = date.substring(4, 6) || '01';
const day = date.substring(6, 8) || '01';