Skip to content

Commit

Permalink
[U] Calendar sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
sauricat committed Sep 17, 2024
1 parent 546ed40 commit 63f3658
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions content/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ const fetchIcal = async () => {
// e.description = e.description.substring(0, e.description.lastIndexOf('<br>'))
}
});
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);
}
Expand Down

0 comments on commit 63f3658

Please sign in to comment.