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