From 969c55f15d6129f898bdecfd9797522116a9cd60 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Wed, 23 Aug 2023 15:14:05 +0200 Subject: [PATCH] Sort dueDates by start date --- .../src/components/dueDates/DueDatesList.vue | 40 +++++++++---------- client/src/stores/courseSessions.ts | 4 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/client/src/components/dueDates/DueDatesList.vue b/client/src/components/dueDates/DueDatesList.vue index b1e662ea..4ba57f1f 100644 --- a/client/src/components/dueDates/DueDatesList.vue +++ b/client/src/components/dueDates/DueDatesList.vue @@ -1,23 +1,3 @@ - - + + diff --git a/client/src/stores/courseSessions.ts b/client/src/stores/courseSessions.ts index 138a7b95..10e2a0da 100644 --- a/client/src/stores/courseSessions.ts +++ b/client/src/stores/courseSessions.ts @@ -209,8 +209,8 @@ export const useCourseSessionsStore = defineStore("courseSessions", () => { function sortDueDates(dueDates: DueDate[]) { dueDates.sort((a, b) => { - const dateA = dayjs(a.end); - const dateB = dayjs(b.end); + const dateA = dayjs(a.start); + const dateB = dayjs(b.start); if (!dateA.isValid() && !dateB.isValid()) return 0; // If both are invalid, they are equal if (!dateA.isValid()) return 1; // If dateA is invalid, it goes after dateB