Re: Not selectable dates
2004/10/01 11:49
Viewed 67713 times
Replies: 5/13

Yes, this is possible.

You have to provide a function that takes a date and returns that day's status, so that the calendar knows wether to disable it or not.  Here's some sample code:

function dateStatus(date) {
var min = new Date(2004,09,30);
var max = new Date(2004,10,05);
if (date.getTime() < min.getTime() ||
date.getTime() > max.getTime())
return true; // true says "disable"
else
return false; // leave other dates enabled
}

Then you need to include this function at Calendar.setup(), like this:

Calendar.setup({
...
dateStatusFunc : dateStatus
...
});

The calendar will call this function for each date in a month and, depending on the result, it will take an action on that date: if your function returns true then the date will be disabled, if it returns false then nothing happens and if it returns a string then that string will be appended to the date's CSS class, thus allowing you to have some “special

Google