mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 13:06:22 +00:00
15 lines
265 B
TypeScript
15 lines
265 B
TypeScript
interface Props {
|
|
date: Date
|
|
}
|
|
|
|
export function formatDate(d: Date): string {
|
|
return d.toLocaleDateString("en-US", {
|
|
year: "numeric",
|
|
month: "short",
|
|
day: "2-digit",
|
|
})
|
|
}
|
|
|
|
export function Date({ date }: Props) {
|
|
return <>{formatDate(date)}</>
|
|
}
|