From b2587004bc09ec63c86294c4e9d3526acbc8cebd Mon Sep 17 00:00:00 2001 From: Filip Borum Poulsen Date: Fri, 21 Apr 2023 12:29:46 +0200 Subject: [PATCH] Sorts timeslots by startTime --- server/src/routes/timeslot.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/routes/timeslot.ts b/server/src/routes/timeslot.ts index 3785f46..0fa8380 100644 --- a/server/src/routes/timeslot.ts +++ b/server/src/routes/timeslot.ts @@ -204,6 +204,8 @@ router.get("/timeslot", async (req: Request, res: Response) => { } } + trainerWithAvailableTimeslots.timeslots.sort((a,b)=>a.startDate.localeCompare(b.startDate)); + trainers.push(trainerWithAvailableTimeslots); }