Jquery fullcalendar hide specific hours

I want to use jquery fullcalendar, but I want to hide certain hours. I want to show the calendar from 8:00 to 11:00 and from 16:00 to 19:00.

Thus, the hours between 11:00 and 16:00 should be "hidden".

I do not see the possibility of doing this: How can I make it?

thanks in advance Christoph

+5
source share
2 answers

You do not want to change the full-screen source, because you want to keep abreast of the official branch.

Then the only way is to hide the corresponding lines (hours) after full calendar initialization using javascript:

//hide rows with unused hours. Class names can be found in html source of
//rendered fullcalendar (fc-slotxx)
for(var i=0; i<gapshours.length; i++)
{
    var gapclass = '.' + gapsclasses[i];
    $(gapclass).hide()           
}

//display hours for clipped borders
for(var i=0; i<sethourhours.length; i++)
{
    var hourclass = '.' + sethourclasses[i] + ' th'
    $(hourclass).text(sethourhours[i]);        
}

After that, you should remember about the periods of clipping and moving events only for viewing purposes.

+4

; .

fullCalendar (. )

events: function(start,end,callback){
  //get your data from wherever you're getting it
  var events = some_ajax_method(start, end);

  //filter it down to the times you want to show
  events = $.map(events, function(event){
    if (event meets time criteria)
      return event
    else
      return null;
  });
  callback(events);
}
0

All Articles