Problem is, how to disable selectable on PAST DATES in fullcalendar\'s month/week view.
I want to user not allowed to click/select the on past dates.
You can combine:
-hide text by CSS as mentioned in question
-disable PREV button on current month
-check date on dayClick/eventDrop etc:
dayClick: function(date, allDay, jsEvent, view) {
var now = new Date();
if (date.setHours(0,0,0,0) < now.setHours(0,0,0,0)){
alert('test');
}
else{
//do something
}
}
This is what I am currently using
Also added the .add() function so the user cannot add an event at the same hour
select: function(start, end, jsEvent, view) {
if(end.isBefore(moment().add(1,'hour').format())) {
$('#calendar').fullCalendar('unselect');
return false;
}
The old answers to this question are ok...
However, the official documentation suggests a new, more concise solution:
First set the day you want to be the lower bound
var today = new Date().toISOString().slice(0,10);
Then include the range using validRange
. Simply omit the end
date.
validRange: {
start: today
}