Disable timeslot ranges in jQuery fullcalendar plugin

Tom picture Tom · Apr 4, 2012 · Viewed 27.2k times · Source

I am developing a webapp and am using jQuery fullcalendar plugin.

I need to somehow disable certain time-slots.

The current method I am using is to add events for the time-slots I want to disable and disallow event overlapping.

Is there a better way to do this? I rather not disallow event overlapping.

I can live with the solution for the above problem: adding black timeslots and disallow the adding of timeslots in those areas.


Nevertheless I have a more pressing problem. I need to be able to change the background color of slots for certain time ranges. Ideally I would be using this in the same way as the eventSources; just point to an url and send the to be colored ranges back with ajax/json.

The bounty I am about to add is for this last problem (colourized slot ranges, as well in day and week view). If someone can suggest me to another solution then full calendar that can do this, that's also fine.

Answer

Adil Malik picture Adil Malik · Jun 29, 2012

BTW, Why don't you check it in Select callback?

select: function( start, end, allDay, jsEvent, view ) {
    if( /*start is the disabled time*/ )
        return false;
    else{
        // Proceed with the normal flow of your application
        // You might show a popup to get info from user to create
        // a new event here
    }
}