I want to disable all Mondays in my jQuery calendar and I am using this code :
function DisableMonday(date) {
alert(date);
var day = date.getDay();
if (day == 1) {
return [false] ;
}
else {
return [true] ;
}
}
jQuery(document).ready(function(){
alert('test');
jQuery('.datepicker').datepicker({
beforeShowDay: DisableMonday()
});
});
my problem seems to be that (date) variable in DisableMonday() function is undefined...how can I solve this problem

beforeShowDay. Instead, you should be passing the function itself (i.e.beforeShowDay: DisableMonday)