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); }