mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-05-18 14:34:23 +02:00
Get TimeZone
This commit is contained in:
parent
3ab0b04cf0
commit
2a4d35435f
@ -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>
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user