Add a minute in endTime working hours when 11:59 is selected (#7852)

Co-authored-by: Bailey Pumfleet <bailey@pumfleet.co.uk>
pull/7862/head
Efraín Rochín 2023-03-21 03:43:36 -07:00 committed by GitHub
parent 7af23305eb
commit d27817ad51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -131,7 +131,9 @@ const isWithinAvailableHours = (
for (const workingHour of workingHours) { for (const workingHour of workingHours) {
const startTime = getTime(timeSlotStart, workingHour.startTime); const startTime = getTime(timeSlotStart, workingHour.startTime);
const endTime = getTime(timeSlotEnd, workingHour.endTime); // workingHours function logic set 1439 minutes when user select the end of the day (11:59) in his schedule
// so, we need to add a minute, to avoid, "No available user" error when the last available slot is selected.
const endTime = getTime(timeSlotEnd, workingHour.endTime === 1439 ? 1440 : workingHour.endTime);
if ( if (
workingHour.days.includes(timeSlotStart.day()) && workingHour.days.includes(timeSlotStart.day()) &&
// UTC mode, should be performant. // UTC mode, should be performant.