From 261d89ebed13691e72312f44339063fee93130ac Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Sat, 30 Mar 2024 16:32:17 +0000 Subject: Astro initial commit --- src/components/FormattedDate.astro | 21 +++++++++++++++++++++ 1 file changed, 21 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..bb7a2c0 --- /dev/null +++ b/src/components/FormattedDate.astro @@ -0,0 +1,21 @@ +--- +interface Props { + className?: string; + date: Date | string; +} + +let { className, date } = Astro.props; +if (typeof(date) === 'string') { + date = new Date(date); +} +--- + + -- cgit v1.2.3