Skip to content

Commit

Permalink
Event sidebar: sort by date
Browse files Browse the repository at this point in the history
  • Loading branch information
ewels committed Feb 2, 2024
1 parent 967d8bf commit 2e8aab8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pages/events/[...event].astro
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2e8aab8

Please sign in to comment.