Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fullcalendar, how to limit the number of events per day in the month view

I have many events on a day, and it works as expected but now looking at the month view, my calendar grid is much taller that expected. I'd like to hide some of these events from the month view, like a summary with a visual que that there are more on this day than can be shown.

I can use eventRender and return false, but i would like to know how many events are on a given day, so i can limit the rendering to about 4, then perhaps i would add an event that says " more ... "

So the question may be : how to count the events on a given date ?

or is this more like a feature request to expose a max counter for month view ?

thanks

like image 763
VNE_Hess Avatar asked Apr 04 '10 19:04

VNE_Hess


1 Answers

As of FullCalendar 2.1.0, this feature is included, just use:

$('#calendarBlock').fullCalendar({
    eventLimit: true
    [...]
});

Demo: http://arshaw.com/js/fullcalendar-2.1.0-beta2/demos/agenda-views.html

Documentation: http://fullcalendar.io/docs/display/eventLimit/

like image 121
Mark Pruce Avatar answered Sep 20 '22 12:09

Mark Pruce