fix: use exclusive end-time boundary in office hours check

time <= amEnd incorrectly allowed 12:00 when the office closes at 12:00.
Changed to time < amEnd (and time < pmEnd) so the session end time is
treated as a closed boundary — a patient cannot start an appointment at
exactly the time the session ends.

Fixes both the SMS reschedule flow and the schedule grid slot highlighting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gitead
2026-05-11 21:44:41 -04:00
parent 5e3cfef52b
commit 3abccf16a9
2 changed files with 4 additions and 4 deletions

View File

@@ -271,8 +271,8 @@ async function isWithinOfficeHours(
const slot = group?.[dayName];
if (!slot?.enabled) continue;
if (
(time >= slot.amStart && time <= slot.amEnd) ||
(time >= slot.pmStart && time <= slot.pmEnd)
(time >= slot.amStart && time < slot.amEnd) ||
(time >= slot.pmStart && time < slot.pmEnd)
) return true;
}
return false;