From cd3f36441e64c809e372e53e6f7b0c5c99649939 Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Fri, 23 Jan 2026 16:30:03 -0600 Subject: [PATCH] fix: create new Date to compare posts --- src/components/ui/sections/LatestPosts.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ui/sections/LatestPosts.astro b/src/components/ui/sections/LatestPosts.astro index c3e80b3..7f79a28 100644 --- a/src/components/ui/sections/LatestPosts.astro +++ b/src/components/ui/sections/LatestPosts.astro @@ -14,7 +14,7 @@ const posts = await directus.request( ); const recentPosts = posts - .sort((a: Post, b: Post) => b.published_date.getTime() - a.published_date.getTime()) + .sort((a: Post, b: Post) => (new Date(b.published_date).getTime()) - (new Date(a.published_date).getTime())) .slice(0, 3); ---