From 456cf011b36de91c9936994b1fa45703adcd309b Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Thu, 3 Jul 2025 10:56:21 +0300 Subject: Initial fork of chrismwilliams/astro-theme-cactus theme --- src/components/FormattedDate.astro | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/components/FormattedDate.astro (limited to 'src/components/FormattedDate.astro') diff --git a/src/components/FormattedDate.astro b/src/components/FormattedDate.astro new file mode 100644 index 0000000..aba7f4d --- /dev/null +++ b/src/components/FormattedDate.astro @@ -0,0 +1,16 @@ +--- +import { getFormattedDate } from "@/utils/date"; +import type { HTMLAttributes } from "astro/types"; + +type Props = HTMLAttributes<"time"> & { + date: Date; + dateTimeOptions?: Intl.DateTimeFormatOptions; +}; + +const { date, dateTimeOptions, ...attrs } = Astro.props; + +const postDate = getFormattedDate(date, dateTimeOptions); +const ISO = date.toISOString(); +--- + + -- cgit v1.2.3