Fix unavailability in calendar while booking

Use moment set date for setting the day of the month. Day is used for day of the week.
This commit is contained in:
jeroenvds 2022-05-23 17:56:11 +02:00 committed by GitHub
parent 6dce7b2f33
commit 148b5df302
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -295,7 +295,7 @@ App.Http.Booking = (function () {
// Grey out unavailability dates.
$('#select-date .ui-datepicker-calendar td:not(.ui-datepicker-other-month)').each((index, td) => {
selectedDateMoment.set({day: index + 1});
selectedDateMoment.set({date: index + 1});
if (unavailabilityDates.indexOf(selectedDateMoment.format('YYYY-MM-DD')) !== -1) {
$(td).addClass('ui-datepicker-unselectable ui-state-disabled');
}