Merge pull request #1223 from Safelite/defect/CSR-1489-2

Update appointment time check to not auto-fail for same-day
This commit is contained in:
chloeherdsafelite 2023-07-11 16:16:23 -04:00 committed by GitHub
commit bec41fec63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2189,6 +2189,7 @@ async function resetScheduleIfUnavailable(context, order) {
// If you put any kind of time stamp on the date string with dashes, then it IS parsed as local time.
var aptDate = new Date(order.schedule.date + "T00:00:00");
var curDate = new Date();
curDate.setHours(0, 0, 0, 0);
// if appointment date is in the past, clear schedule
if (aptDate.getTime() < curDate.getTime()) {