Upgraded next and prisma. Replaced moment-timezone.

This commit is contained in:
Mike Cao 2024-11-22 04:04:13 -08:00
parent 620a838173
commit fccb1ddd9a
7 changed files with 3036 additions and 160 deletions

View file

@ -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) {