From 2e8aab8aebdf5f5cb1f216ade370aa1520fbdc0e Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Sat, 3 Feb 2024 00:19:14 +0100 Subject: [PATCH] Event sidebar: sort by date --- src/pages/events/[...event].astro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/events/[...event].astro b/src/pages/events/[...event].astro index d463ab903a..623caa45bc 100644 --- a/src/pages/events/[...event].astro +++ b/src/pages/events/[...event].astro @@ -65,6 +65,9 @@ const sections = years.map((year) => { event.slug.endsWith('index.mdx') ); }) + .sort((a, b) => { + return new Date(b.data.start) - new Date(a.data.start); + }) .map((event, i) => { return { title: event.data.title,