Timezone/UX issue: Wrong day is selected when timezone differs by -1 day (#961).

This commit is contained in:
Alex Tselegidis 2021-07-19 16:02:45 +03:00
parent cc6575d2d0
commit 39cc1b5a0b

View file

@ -100,6 +100,10 @@ window.FrontendBookApi = window.FrontendBookApi || {};
.tz(selectedDate + ' ' + availableHour + ':00', providerTimezone)
.tz(selectedTimezone);
if (availableHourMoment.format('YYYY-MM-DD') !== selectedDate) {
return; // Due to the selected timezone the available hour belongs to another date.
}
$('#available-hours').append(
$('<button/>', {
'class': 'btn btn-outline-secondary btn-block shadow-none available-hour',
@ -127,8 +131,9 @@ window.FrontendBookApi = window.FrontendBookApi || {};
}
FrontendBook.updateConfirmFrame();
}
} else {
if (!$('.available-hour').length) {
$('#available-hours').text(EALang.no_available_hours);
}
});