From a66f6aa9c444f4cf7671fe6c6f466e4dce4d1f31 Mon Sep 17 00:00:00 2001 From: Artem Bulgakov Date: Sat, 26 Oct 2024 23:48:34 +0300 Subject: [PATCH] fix(room-booking): couldn't book after last booking in timeline --- src/components/room-booking/timeline/BookingTimeline.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/room-booking/timeline/BookingTimeline.vue b/src/components/room-booking/timeline/BookingTimeline.vue index 6dbbb9b..d152e17 100644 --- a/src/components/room-booking/timeline/BookingTimeline.vue +++ b/src/components/room-booking/timeline/BookingTimeline.vue @@ -314,7 +314,10 @@ function rangeIntersectingBookings( if (l !== r) return []; - if (bookings[l].startsAt.getTime() >= bMs) + if ( + bookings[l].startsAt.getTime() >= bMs || + bookings[l].endsAt.getTime() <= aMs + ) // First and doesn't intersect. return []; @@ -568,6 +571,7 @@ function validSlotByState(state: InteractionState): Slot | null { state.hoverAt.room.id, ); + console.log({ range }); if (!range) return null; return {