---
import type { HTMLAttributes } from 'astro/types'

interface Props extends HTMLAttributes<'time'> {
	date: Date
}

const { date, ...attrs } = Astro.props

const formattedDate = date.toISOString().slice(0, 10).replace(/-/g, '')
---

<time datetime={date.toISOString()} {...attrs}>
	{formattedDate}
</time>
