Use full timezone name.

This commit is contained in:
DarShan Pandya committed 2024-03-10 21:08:32 +05:30
1 parent 2e4cc2229b
commit 068fa42ebf
1 file changed
+3 -3
+3 -3
View File
@@ -119,13 +119,13 @@ export const utcWeekDayToLocaleWeekDay = (utcDay: WeekDay, utcTimeString: string
return new Intl.DateTimeFormat('en', { weekday: 'short' }).format(now);
};
export const localeTimezoneShortHand = () => {
export const localeTimezoneName = () => {
const options: Intl.DateTimeFormatOptions = {
timeZoneName: 'long'
timeZoneName: 'longGeneric'
};
const dateWithTimezone = new Intl.DateTimeFormat('en', options).format(new Date());
return dateWithTimezone.match(/\b([A-Z])/g).join('');
return dateWithTimezone.split(', ')[1];
};
export const isSameDay = (date1: Date, date2: Date) => {