Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery fullcalendar hide certain hours

I want to use jquery fullcalendar but I want to hide certain hours. I want to show the calendar from 8.00am->11.00am and from 16:00pm->19:00pm

So the hours between 11:00am and 16:00pm must be 'hidden'.

I don't see an option to do this : How can I force this ?

thx in advance Kristof

like image 354
user426722 Avatar asked Nov 15 '11 18:11

user426722


1 Answers

You don't want to modify fullcalendar source because you want to be up to date with official branch.

Then the only way is to hide appropriate rows (hours) after fullcalendar initialization with 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 must remember of clipping and moving events' periods just for view purposes.

like image 192
4N0 Avatar answered Sep 25 '22 15:09

4N0