Fixes that sometimes last shown slot was unavailable (#7804)

* fix unavailable slots + add relevant test

* code clean up

---------

Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
Carina WollendorferandCarinaWolli authored and GitHub committed 2023-03-17 13:02:56 -07:00
1 parent 13577a5dbe
commit 6128be8860
2 files changed
+22 -1

No files matched your search

+1 -1
View File
@@ -87,7 +87,7 @@ function buildSlots({
for (let slotStart = boundaryStart; slotStart < boundaryEnd; slotStart += frequency) {
computedLocalAvailability.forEach((item) => {
// TODO: This logic does not allow for past-midnight bookings.
if (slotStart < item.startTime || slotStart > item.endTime + 15 - eventLength) {
if (slotStart < item.startTime || slotStart > item.endTime + 1 - eventLength) {
return;
}
slotsTimeFrameAvailable[slotStart.toString()] = {