Due to jquery ui datepicker issue the unavailable dates will be greyed out manually by adding the required classes.

This commit is contained in:
Alex Tselegidis 2016-06-29 21:25:57 +02:00
parent 0522186a4e
commit b9e24f7baf

View file

@ -230,15 +230,13 @@ window.FrontendBookApi = window.FrontendBookApi || {};
$('#available-hours').text(EALang['no_available_hours']);
}
// Apply the new beforeShowDayHandler method to the #select-date datepicker.
var beforeShowDayHandler = function(date) {
if ($.inArray(date.toString('yyyy-MM-dd'), response) != -1) {
return [false];
// Grey out unavailable dates.
$('#select-date .ui-datepicker-calendar td:not(.ui-datepicker-other-month)').each(function(index, td) {
selectedDate.set({day: index + 1});
if ($.inArray(selectedDate.toString('yyyy-MM-dd'), response) != -1) {
$(td).addClass('ui-datepicker-unselectable ui-state-disabled');
}
return [true];
};
$('#select-date').datepicker('option', 'beforeShowDay', beforeShowDayHandler);
});
})
.fail(GeneralFunctions.ajaxFailureHandler);
};