From 248d82e739e5c3f25995b95141ade6ea5478f3ef Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 8 Jan 2024 18:42:25 -0500 Subject: [PATCH] Clean up date comparision fix --- website/src/.vitepress/config/hooks/generateFeed.ts | 2 +- website/src/.vitepress/theme/data/news.data.ts | 2 +- website/src/news/2023-09-10-updated-website.md | 2 +- website/src/news/2024-01-09-extensions-removal.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/website/src/.vitepress/config/hooks/generateFeed.ts b/website/src/.vitepress/config/hooks/generateFeed.ts index 3a4ec9e6..70b76da4 100644 --- a/website/src/.vitepress/config/hooks/generateFeed.ts +++ b/website/src/.vitepress/config/hooks/generateFeed.ts @@ -47,7 +47,7 @@ async function generateFeed(config: SiteConfig, hostname: string) { link: fullUrl, description: frontmatter.description, content, - date: typeof frontmatter.date == 'string' ? new Date(frontmatter.date) : frontmatter.date, + date: frontmatter.date, } satisfies Item feed.addItem(post) diff --git a/website/src/.vitepress/theme/data/news.data.ts b/website/src/.vitepress/theme/data/news.data.ts index 17950416..7341bc1e 100644 --- a/website/src/.vitepress/theme/data/news.data.ts +++ b/website/src/.vitepress/theme/data/news.data.ts @@ -24,6 +24,6 @@ export default createContentLoader('news/*.md', { url, }, ) - .sort((a, b) => b.date.localeCompare(a.date)) + .sort((a, b) => b.date.toString().localeCompare(a.date.toString())) }, }) diff --git a/website/src/news/2023-09-10-updated-website.md b/website/src/news/2023-09-10-updated-website.md index 8521daa6..6de1878d 100644 --- a/website/src/news/2023-09-10-updated-website.md +++ b/website/src/news/2023-09-10-updated-website.md @@ -2,7 +2,7 @@ type: article title: Updated website description: We've got a fresh new website we hope will be even easier to use -date: "2023-09-10" +date: 2023-09-10 --- # Updated website diff --git a/website/src/news/2024-01-09-extensions-removal.md b/website/src/news/2024-01-09-extensions-removal.md index cd9c5009..75c66a47 100644 --- a/website/src/news/2024-01-09-extensions-removal.md +++ b/website/src/news/2024-01-09-extensions-removal.md @@ -2,7 +2,7 @@ type: article title: Extensions list removed description: Due to extenuating circumstances. -date: "2024-01-09" +date: 2024-01-09 --- # Extensions list removed