Make browser only

This commit is contained in:
pancakes 2024-04-24 20:19:21 +10:00
parent c130c1be4c
commit 0c40ac4646

View file

@ -1,4 +1,6 @@
<script> <script>
import { browser } from "$app/environment";
/** @type string | undefined */ /** @type string | undefined */
export let datetime = undefined; export let datetime = undefined;
/** @type "date" | "dateTime" | "time" */ /** @type "date" | "dateTime" | "time" */
@ -23,7 +25,7 @@
} }
const formattedDate = Intl.DateTimeFormat( const formattedDate = Intl.DateTimeFormat(
navigator.language, browser ? navigator.language : "en",
options, options,
).format(date); ).format(date);
</script> </script>