quartz-research-note/quartz/components/Date.tsx
2023-08-08 21:28:09 -07:00

16 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)}</>
}