@amimpact/willy-utils 4.10.0 → 4.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/date.ts +3 -3
package/package.json
CHANGED
package/src/date.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
subDays,
|
|
8
8
|
} from 'date-fns';
|
|
9
9
|
import { nl } from 'date-fns/locale';
|
|
10
|
-
import {
|
|
10
|
+
import { TZDate } from '@date-fns/tz';
|
|
11
11
|
import { parse as parseISO } from './includes/tinyduration';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -236,7 +236,7 @@ export const formatDateFromNow = (dateObject: CraftDate, options: FormatDateFrom
|
|
|
236
236
|
|
|
237
237
|
const parsed = isString
|
|
238
238
|
? new Date(dateObject).toString()
|
|
239
|
-
:
|
|
239
|
+
: new TZDate(dateObject.date, dateObject.timezone);
|
|
240
240
|
|
|
241
241
|
/**
|
|
242
242
|
* Datum tonen voor ouder dan x tijd
|
|
@@ -286,7 +286,7 @@ export const formatNewDate = (dateObject: CraftDate) => {
|
|
|
286
286
|
|
|
287
287
|
const parsed = isString
|
|
288
288
|
? new Date(dateObject).toString()
|
|
289
|
-
:
|
|
289
|
+
: new TZDate(dateObject.date, dateObject.timezone);
|
|
290
290
|
|
|
291
291
|
return new Date(parsed);
|
|
292
292
|
};
|