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

type Props = HTMLAttributes<'time'> & {
	date: Date;
};

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

<time datetime={date.toISOString()} {...attrs}>
	{
		date.toLocaleDateString('en-us', {
			year: 'numeric',
			month: 'short',
			day: 'numeric',
		})
	}
</time>

<style>
	time {
		display: block;
	}
</style>
