mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-22 14:42:23 +03:00
Due to jquery ui datepicker issue the unavailable dates will be greyed out manually by adding the required classes.
This commit is contained in:
parent
0522186a4e
commit
b9e24f7baf
1 changed files with 6 additions and 8 deletions
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue