From e3ad889c54039a7138bf1e83a22f014b45ec0990 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Thu, 29 Jul 2021 16:08:35 +0000 Subject: [PATCH] Fixes Shifting the selected working days --- lib/slots.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/slots.ts b/lib/slots.ts index e4fdaa41..f0ec4ff6 100644 --- a/lib/slots.ts +++ b/lib/slots.ts @@ -121,17 +121,14 @@ const getSlots = ({ // current date in invitee tz const currentDate = dayjs().utcOffset(inviteeDate.utcOffset()); const startDate = currentDate.add(minimumBookingNotice, "minutes"); // + minimum notice period - // when the invitee date is not the same as the current date, reset the date to the start of day - if (inviteeDate.date() !== currentDate.date()) { - inviteeDate = inviteeDate.startOf("day"); - } const startTime = startDate.isAfter(inviteeDate) ? // block out everything when inviteeDate is less than startDate - startDate.date() > inviteeDate.date() + startDate.diff(inviteeDate, "day") > 0 ? 1440 : startDate.hour() * 60 + startDate.minute() : 0; + const inviteeBounds = inviteeBoundary(startTime, inviteeDate.utcOffset(), frequency); return getOverlaps(