Get TimeZone

This commit is contained in:
Emile Bangma 2024-12-09 00:09:03 +00:00
parent 3ab0b04cf0
commit 2a4d35435f

View File

@ -23,9 +23,10 @@ export function formatDate(d: Date, locale: ValidLocale = "en-US"): string {
year: "numeric", year: "numeric",
month: "short", month: "short",
day: "2-digit", day: "2-digit",
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
}) })
} }
export function Date({ date, locale }: Props) { export function Date({ date, locale }: Props) {
return <time datetime={formatDate(date)}>{formatDate(date, locale)}</time> return <time datetime={date.toISOString()}>{formatDate(date, locale)}</time>
} }