Timezone/UX issue: Wrong day is selected when timezone differs by -1 day (#961).
This commit is contained in:
parent
cc6575d2d0
commit
39cc1b5a0b
1 changed files with 6 additions and 1 deletions
|
@ -99,6 +99,10 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
||||||
var availableHourMoment = moment
|
var availableHourMoment = moment
|
||||||
.tz(selectedDate + ' ' + availableHour + ':00', providerTimezone)
|
.tz(selectedDate + ' ' + availableHour + ':00', providerTimezone)
|
||||||
.tz(selectedTimezone);
|
.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(
|
$('#available-hours').append(
|
||||||
$('<button/>', {
|
$('<button/>', {
|
||||||
|
@ -127,8 +131,9 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
||||||
}
|
}
|
||||||
|
|
||||||
FrontendBook.updateConfirmFrame();
|
FrontendBook.updateConfirmFrame();
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
if (!$('.available-hour').length) {
|
||||||
$('#available-hours').text(EALang.no_available_hours);
|
$('#available-hours').text(EALang.no_available_hours);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue