diff --git a/src/utils/time.ts b/src/utils/time.ts index bc04f6d..d63c7f2 100644 --- a/src/utils/time.ts +++ b/src/utils/time.ts @@ -9,8 +9,9 @@ import moment from "moment-timezone"; */ export const showDate = (tz: string, locale: Map, date: Date) => { const localeInfo = new Intl.Locale(tz); + const intlTimezone = moment.tz.zonesForCountry(localeInfo.region ?? localeInfo.baseName); const formattedDate = new Intl.DateTimeFormat(tz, { - timeZone: moment.tz.zonesForCountry(localeInfo.region ?? localeInfo.baseName)[0], + timeZone: intlTimezone ? intlTimezone[0] : "Etc/GMT", dateStyle: "short", timeStyle: "medium", })