Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove past dates and next months dates from the current month

Tags:

Is it possible to remove the past dates and next month's dates from the fullcalendar? So for the current month it should display only current dates and days.

like image 239
rubyist Avatar asked Oct 02 '11 17:10

rubyist


2 Answers

You could try skipping the events in the eventRender() method:

eventRender: function(event, element, view)
{
   if(event.start.getMonth() !== view.start.getMonth()) { return false; }
}
like image 142
Bascht Avatar answered Jan 14 '23 05:01

Bascht


Add this setting showNonCurrentDates: false. With this setting, dates and events that do not belong to the current month will not be shown.

$('#calendarId').fullCalendar({
     // Other settings
     showNonCurrentDates: false            
});
like image 42
Kihats Avatar answered Jan 14 '23 05:01

Kihats