diff --git a/frontend/src/routes/@[username]/edit/other/+page.svelte b/frontend/src/routes/@[username]/edit/other/+page.svelte index b653010..fe659c4 100644 --- a/frontend/src/routes/@[username]/edit/other/+page.svelte +++ b/frontend/src/routes/@[username]/edit/other/+page.svelte @@ -42,6 +42,8 @@ let displayTimezone = ""; $: setTime($user.timezone); + const validTimezones = Intl.supportedValuesOf("timeZone"); + const detectTimezone = () => { $user.timezone = DateTime.local().zoneName; }; @@ -147,14 +149,21 @@

- + + + {#each validTimezones as timezone}

{#if $user.timezone} This will show up on your profile like this: - - {currentTime} (UTC{displayTimezone}) + {#if validTimezones.some((zone) => zone === $user.timezone)} + + {currentTime} (UTC{displayTimezone}) + {:else} + not a valid timezone + {/if}
{/if}