blob: 3718664d5c96dcff71fff32271b6a665ce7c9fe5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
---
import type { HTMLAttributes } from "astro/types";
interface Props {
date: Date;
locales?: Intl.LocalesArgument;
options: Intl.DateTimeFormatOptions;
itemprop?: HTMLAttributes<"time">["itemprop"];
}
const { date, locales, options } = Astro.props;
const datetime = date.toISOString();
const format = new Intl.DateTimeFormat(locales, options).format(date);
---
<time {datetime}>{format}</time>
|