Multiple-Dates-Picker-for-jQuery-UI
Multiple-Dates-Picker-for-jQuery-UI copied to clipboard
how can i disable all dates except some dates from my list
+1
+1
I'm writing a screen to allow supervisors to approve employees' requested vacation days. Would like to allow selection of only the requested days.
You can update the options and supply a new function for 'beforeShowDay'.
multiDatePicker.multiDatesPicker({
beforeShowDay: disableAllDaysExcept,
});
function disableAllDaysExcept(date){
//Do some logic to see if the date matches those in your list, where you would return true. Otherwise return false.
}
The date variable is a standard javascript date object
function disableSpecificWeekDays(date) {
var theday = date.getDate() + '/' +
(date.getMonth() + 1) + '/' +date.getFullYear();
console.log(theday);//31/12/1999
var day = date.getDay();
return [day != 0 && day != 6];
}
And if you just want to disable all dates you would return false always in your supplied function