So after trying
this example, the first two dates I've entered to be unavailable work, except for the last date.
jQuery(document).ready(function (jQ) {
jQ( '#dp_a' ).datepicker({
minDate: 0,
onSelect: checkDate
});
function checkDate(start_date, el) {
jQ( '#dp_b' ).datepicker('option', 'disabled', false);
jQ( '#dp_b' ).datepicker('option', 'minDate', start_date);
}
// note the following line would be set dynamically in a real application
var unavailableDates = ['9-3-2016','19-3-2016','29-3-2016'];
jQ( '#dp_b' ).datepicker({
numberOfMonths: 6,
minDate: +10,
maxDate: '+1M +10D',
beforeShowDay: unavailable
});
jQ( '#dp_b' ).datepicker('option', 'disabled', true);
function unavailable(date) {
dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
if (jQ.inArray(dmy, unavailableDates) == -1) {
return [true, ''];
} else {
return [false, '', 'Unavailable'];
}
}
});
The last date is not only highlighted but the last week of the month is selected and the other months afterwards. This is odd behavior and doesn't match the example screenshot shown
on this page.
[attachment=0]calendar-unavailable-dates.GIF[/attachment]
So then where is the malfunction coming from?