<input id="datepicker">
var picker = new Pikaday({
disableDayFn: function(date){
// Disable Monday
return date.getDay() === 1;
},
field: document.getElementById('datepicker')
});
Currently above code is disabling one day, I want it to disable two days. please help me out to sort it
Example : JsFiddle : http://jsfiddle.net/jpwk4wpv/
Use ||
(OR) operation inside disableDayFn
as shown :-
var picker = new Pikaday({
disableDayFn: function(date){
// Disable Monday and Tuesday
return (date.getDay() === 1 || date.getDay() === 2);
},
field: document.getElementById('datepicker')
});