$(document).ready(function () {
// alert('Test');
// Hard Code List of Dates
var availableDates = ["11-1-2021","17-1-2021","25-1-2021"];
function available(date) {
dmy = date.getDate() + "-" + (date.getMonth()+1) + "-" + date.getFullYear() ;
if ($.inArray(dmy, availableDates) != -1) {
return [true, "","Available"];
} else {
return [false,"","unAvailable"];
}
}
$.datepicker.setDefaults({ beforeShowDay:available });
}); //end of $(document).ready(function () {
I have found code to be able to restrict the Calendar to a list of specific dates.
Issue is this applies to all Calendars on the Form.
I do not seem to be able to use a Selector to specify which Date Field this should apply to.
This line works:
$.datepicker.setDefaults({ beforeShowDay:available });
Using:
$('#q1').datepicker.setDefaults({ beforeShowDay:available });
"or"
$('.daterestrict').datepicker.setDefaults({ beforeShowDay:available });