aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/FormattedDate.astro7
-rw-r--r--src/components/Header.astro1
2 files changed, 5 insertions, 3 deletions
diff --git a/src/components/FormattedDate.astro b/src/components/FormattedDate.astro
index 1bcce73..fd9f7a6 100644
--- a/src/components/FormattedDate.astro
+++ b/src/components/FormattedDate.astro
@@ -1,14 +1,15 @@
---
interface Props {
- date: Date;
+ date: Date | string | number;
}
const { date } = Astro.props;
+const formattedDate = date instanceof Date ? date : new Date(date);
---
-<time datetime={date.toISOString()}>
+<time datetime={formattedDate.toISOString()}>
{
- date.toLocaleDateString('en-us', {
+ formattedDate.toLocaleDateString('en-us', {
year: 'numeric',
month: 'short',
day: 'numeric',
diff --git a/src/components/Header.astro b/src/components/Header.astro
index d8a68b0..14ff099 100644
--- a/src/components/Header.astro
+++ b/src/components/Header.astro
@@ -94,6 +94,7 @@ import { SITE_TITLE } from '../consts';
<HeaderLink href="/">Home</HeaderLink>
<HeaderLink href="/blog">Blog</HeaderLink>
<HeaderLink href="/about">About</HeaderLink>
+ <HeaderLink href="/micro">Micro</HeaderLink>
<HeaderLink href="/rss.xml">RSS</HeaderLink>
</nav>
<div class="logo">
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage