From 63f3658067add722d529ca2b89021c4feed04037 Mon Sep 17 00:00:00 2001 From: sauricat Date: Mon, 16 Sep 2024 21:44:21 -0400 Subject: [PATCH] [U] Calendar sorted --- content/Calendar.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/content/Calendar.vue b/content/Calendar.vue index 8097d51..3e49cdc 100644 --- a/content/Calendar.vue +++ b/content/Calendar.vue @@ -52,8 +52,12 @@ const fetchIcal = async () => { // e.description = e.description.substring(0, e.description.lastIndexOf('
')) } }); - - evs.value = events; + evs.value = events + .sort((a, b) => { + if (a.start && b.start) return a.start.getTime() - b.start.getTime(); + return 0; + }) + .reverse(); } catch (error) { console.error('There was a problem with the fetch operation:', (error as Error).message); }