Skip to content

Commit

Permalink
fix(events): sort by date
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Dec 12, 2024
1 parent 02e9f24 commit 0119d8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export async function getLatestEvents(num = 5) {
const { events } = await getAllEvents()

return {
events: events.slice(0, num),
events: events.slice(0, num).sort((a, b) => {
return new Date(b.dateTime) - new Date(a.dateTime)
}),
}
}

Expand Down

0 comments on commit 0119d8a

Please sign in to comment.