I have a system in Classic ASP, where I have a scheduling schedule. I need to disable the dates included in the holidays and compensations table (meeting_id and date). I do not know how to do this select to populate an array of unavailable dates.
To do something like the line of the unavailableDates variable.
var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];
var unavailableDates = ["2012/03/26","2012/03/27","2012/04/05"]; // yyyy/MM/dd**
var unavailableDays = ["Saturday","Sunday"];
function unavailable(date) {
ymd = date.getFullYear() + "/" + ("0"+(date.getMonth()+1)).slice(-2) + "/" + ("0"+date.getDate()).slice(-2);
day = new Date(ymd).getDay();
if ($.inArray(ymd, unavailableDates) < 0 && $.inArray(days[day], unavailableDays) < 0) {
return [true, "enabled", "Book Now"];
} else {
return [false,"disabled","Booked Out"];
}
}
$('#iDate').datepicker({ beforeShowDay: unavailable });