fix: linting

This commit is contained in:
Jason Rasmussen
2023-11-22 00:05:59 -05:00
parent 95e5f0acc9
commit 0ed15659fe

View File

@@ -1,3 +1,11 @@
<script lang="ts" context="module">
// eslint-disable-next-line @typescript-eslint/no-namespace
declare namespace Intl {
type Key = 'calendar' | 'collation' | 'currency' | 'numberingSystem' | 'timeZone' | 'unit';
function supportedValuesOf(input: Key): string[];
}
</script>
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import { DateTime } from 'luxon';
@@ -10,9 +18,10 @@
offset: string;
}
const timezones: ZoneOption[] = (Intl as any)
.supportedValuesOf('timeZone')
.map((zone: string) => ({ zone, offset: 'UTC' + DateTime.local({ zone }).toFormat('ZZ') }));
const timezones: ZoneOption[] = Intl.supportedValuesOf('timeZone').map((zone: string) => ({
zone,
offset: 'UTC' + DateTime.local({ zone }).toFormat('ZZ'),
}));
const initialOption = timezones.find((item) => item.offset === 'UTC' + initialDate.toFormat('ZZ'));