From 1d33c8b39f1892f4f1b51dc24b10b955fad5a306 Mon Sep 17 00:00:00 2001 From: Christian Gawron Date: Wed, 16 Oct 2024 20:20:15 +0200 Subject: [PATCH] fix: make sure appointsments end inside available slot - take duration into account properly --- client/src/pages/Booking.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/pages/Booking.tsx b/client/src/pages/Booking.tsx index 449a38d..aeff4fc 100644 --- a/client/src/pages/Booking.tsx +++ b/client/src/pages/Booking.tsx @@ -188,7 +188,7 @@ const Booking = (props: any) => { let end = new Date(slot.end); console.log("start: %s, end: %s", start, end); let s = start; - while (s < end) { + while (s < addMinutes(end, -event.duration)) { times.push(s); s = addMinutes(s, event.duration); }