nzambello.dev/src/components/FormattedDate.astro
2023-05-31 10:10:31 +02:00

18 lines
244 B
Plaintext

---
export interface Props {
date: Date
}
const { date } = Astro.props
---
<time datetime={date.toISOString()}>
{
date.toLocaleDateString('en-us', {
year: 'numeric',
month: 'short',
day: 'numeric'
})
}
</time>