the horrors

This commit is contained in:
Laker Turner 2025-03-17 12:49:54 +00:00
parent 0d9be3d002
commit 4245370f61
No known key found for this signature in database
48 changed files with 2513 additions and 265 deletions

View file

@ -0,0 +1,17 @@
---
export interface Props {
date: string | Date;
}
const { date } = Astro.props;
if (!date) {
return null;
}
const dateObj = typeof date === "string" ? new Date(date) : date;
const options = { year: "numeric", month: "long", day: "numeric" };
const formattedDate = dateObj.toLocaleDateString("en-GB", options);
const isoDate = dateObj.toISOString();
---
<time datetime={isoDate}>{formattedDate}</time>