mirror of
https://github.com/supabase/supabase.git
synced 2026-05-30 09:23:00 +08:00
15 lines
307 B
TypeScript
15 lines
307 B
TypeScript
export function DateFormat({
|
|
date,
|
|
options,
|
|
}: {
|
|
date: string
|
|
options?: Intl.DateTimeFormatOptions
|
|
}) {
|
|
const dateObject = new Date(date)
|
|
return (
|
|
<time dateTime={dateObject.toISOString()} suppressHydrationWarning>
|
|
{dateObject.toLocaleDateString(undefined, options)}
|
|
</time>
|
|
)
|
|
}
|