Has anyone figured out how to configure datepicker to not display specific dates (such as, say, July 4th)? It would seem that this could be done using the beforeShowDay but I'm not positive.
//a array of dates that should be blocked
var forbidden=['12/25/2014','12/24/2014']
$('#datepicker').datepicker({
beforeShowDay:function(Date){
//
var curr_day = Date.getDate();
var curr_month = Date.getMonth()+1;
var curr_year = Date.getFullYear();
var curr_date=curr_month+'/'+curr_day+'/'+curr_year;
if (forbidden.indexOf(curr_date)>-1) return false;
}
})
OR:
http://jsfiddle.net/zsqvjvkd/1/
var forbidden=['2014-12-25','2014-12-24']
$('#datepicker').datepicker({
beforeShowDay:function(Date){
var curr_date = Date.toJSON().substring(0,10);
if (forbidden.indexOf(curr_date)>-1) return false;
}
})