mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 21:57:16 +01:00
Upgraded next and prisma. Replaced moment-timezone.
This commit is contained in:
parent
620a838173
commit
fccb1ddd9a
7 changed files with 3036 additions and 160 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import moment from 'moment-timezone';
|
||||
import {
|
||||
addMinutes,
|
||||
addHours,
|
||||
|
|
@ -105,8 +104,17 @@ const DATE_FUNCTIONS = {
|
|||
},
|
||||
};
|
||||
|
||||
export function isValidTimezone(timezone: string) {
|
||||
try {
|
||||
Intl.DateTimeFormat(undefined, { timeZone: timezone });
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export function getTimezone() {
|
||||
return moment.tz.guess();
|
||||
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
}
|
||||
|
||||
export function parseDateValue(value: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue