How disable specific dates from the PPOM datepicker
-
Hi,
How to disable specific dates form the date picker. I need help blocking out Sunday, Monday and Tuesday from the calendar and few particular dates.
I am trying to use a jquery to implement this. So far I have written this below code but seems to be not working:
var dateToday = new Date();
jQuery(document).ready(function(){
jQuery(‘#preferred_collection_date’).datepicker({
beforeShowDay: checkAvailable,
minDate: dateToday
});
});var unavailableDates = [“19-11-2020″,”1-12-2020″,”15-11-2020”];
function checkAvailable(date) {
dmy = date.getDate() + “-” + (date.getMonth() + 1) + “-” + date.getFullYear();
if (jQuery.inArray(dmy, unavailableDates) != -1) {return [false, “”, “unAvailable”];
} else {
var day = date.getDay();
return [(day != 0 && day != 1 && day ! = 2)];
}
}Any help would really be appreciated. Thanks.
The page I need help with: [log in to see the link]
The topic ‘How disable specific dates from the PPOM datepicker’ is closed to new replies.