From bb420a94eb3b35c61f276b66c91f3f17ca2b07e8 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 17 Aug 2021 13:26:39 +0200 Subject: fix post sorting --- pages/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/index.tsx b/pages/index.tsx index d2be08e..634950d 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -68,7 +68,10 @@ export default function Home(props: { {index == 0 && <>

Recent posts

- {posts.posts.reverse().slice(0, 4).map(post => { + {posts.posts.sort((a, b) => ( + new Date(a.date).getTime() - + new Date(b.date).getTime() + )).reverse().slice(0, 4).map(post => { return ; })}
-- cgit v1.2.3