diff options
| author | Ellie Huxtable <ellie@atuin.sh> | 2024-07-10 17:11:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-10 17:11:34 +0100 |
| commit | 69def05f759f29384ca242f57adc8600aff6de72 (patch) | |
| tree | 160d523ef8a938ad0b701ed5d320bbda2030ad4c /ui/src/lib | |
| parent | chore(deps): update prost-types (#2251) (diff) | |
| download | atuin-69def05f759f29384ca242f57adc8600aff6de72.zip | |
fix(gui): weekInfo call on Edge (#2252)
Diffstat (limited to 'ui/src/lib')
| -rw-r--r-- | ui/src/lib/utils.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ui/src/lib/utils.ts b/ui/src/lib/utils.ts index c56d3687..db66b3be 100644 --- a/ui/src/lib/utils.ts +++ b/ui/src/lib/utils.ts @@ -29,3 +29,20 @@ const twMerge = extendTailwindMerge({ export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } + +// edge still uses the old one +export function getWeekInfo() { + let locale = new Intl.Locale(navigator.language); + + // @ts-ignore + if (locale.getWeekInfo) { + // @ts-ignore + return locale.getWeekInfo(); + // @ts-ignore + } else if (locale.weekInfo) { + // @ts-ignore + return locale.weekInfo; + } + + throw new Error("Could not fetch week info via new or old api"); +} |
