We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 978b6b8 commit 47d1b94Copy full SHA for 47d1b94
src/pages/events/[id]/dynamic-images/debug.astro
@@ -2,6 +2,7 @@
2
import { getEventsCollection } from "@/lib/events";
3
import { getEventStaticPaths } from "./_utils";
4
import MainLayout from "@/layouts/MainLayout.astro";
5
+import dayjs from "dayjs";
6
7
export const getStaticPaths = () =>
8
import.meta.env.DEV ? getEventStaticPaths() : [];
@@ -19,7 +20,9 @@ const fileNames = files.map((path) => {
19
20
21
const props = Astro.props;
22
-const allEvents = await getEventsCollection();
23
+const allEvents = (await getEventsCollection()).sort((a, b) =>
24
+ dayjs(b.data.date).diff(a.data.date),
25
+);
26
---
27
28
<MainLayout>
0 commit comments