mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-10 07:26:48 +02:00
♻️ Switch to app router (#922)
This commit is contained in:
parent
41f85279bb
commit
95feb9f01a
181 changed files with 2507 additions and 2494 deletions
|
@ -10,8 +10,11 @@ dayjs.extend(timezone);
|
|||
export const getTimeZoneAbbreviation = (date: Date, timeZone: string) => {
|
||||
const timeZoneDisplayFormat = soft(timeZone)[0];
|
||||
const spaceTimeDate = spacetime(date, timeZone);
|
||||
const standardAbbrev = timeZoneDisplayFormat.standard.abbr;
|
||||
const dstAbbrev = timeZoneDisplayFormat.daylight?.abbr;
|
||||
if (!timeZoneDisplayFormat) {
|
||||
console.error(`No timezone display format for ${timeZone}`);
|
||||
}
|
||||
const standardAbbrev = timeZoneDisplayFormat?.standard.abbr ?? timeZone;
|
||||
const dstAbbrev = timeZoneDisplayFormat?.daylight?.abbr ?? timeZone;
|
||||
const abbrev = spaceTimeDate.isDST() ? dstAbbrev : standardAbbrev;
|
||||
return abbrev;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue