I'm working with fullcalendar and am wondering if there is a way to make certain dates unclickable. The function I have so far compares all "day squares" dates on the calendar to a maximum date I have defined earlier. If the date goes beyond the max date I add a class to grey them out. They are still clickable. Hiding them screws with the layout of the calendar and looks awful.
// Grey out the dates that go beyond the maximum availability date
var maxParsed = Date.parse(maxDate.toString());
$("td[data-date]").each(function(){
var date = $(this).data('date');
var dateParsed = Date.parse(date);
if(!isNaN(dateParsed) && dateParsed > maxParsed){
$(this).addClass('fc-other-month');
}
});