Tagged: datepicker, disable
Hi, similar to this post, I would like to disable specific dates in the datepicker, say 2016-12-26. Can you help out? Grazie!
Hey lijndiensten,
Please replace
beforeShowDay: function(date) {
var day = date.getDay();
return [(day != 2)];
},
with following one
beforeShowDay: function(date) {
var day = date.getDay();
function IsChristmas(date) {
var day = date.getDate();
var month = date.getMonth() + 1;
return (day === 26 && month === 12);
}
return [(day != 0 && !IsChristmas(date))];
},
Best regards,
Yigit
Hi Yigit,
Thanks a lot for your help. This blocks Dec. 26, but does not block Tuesdays. Is there a way to do both?
Thanks,
Ivan
Hey!
Oh sorry. Please change the code to following one
beforeShowDay: function(date) {
var day = date.getDay();
function IsChristmas(date) {
var day = date.getDate();
var month = date.getMonth() + 1;
return (day === 26 && month === 12);
}
return [(day != 2 && !IsChristmas(date))];
},
Cheers!
Yigit
You are my javascript-hero, many thanks.
Enjoy the holidays :)
Ivan
Hey!
You are welcome! :)
For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)
Happy holidays!
Regards,
Yigit