7

I have a calendar that displays appointments for particular person. How do I set fullcalendar up so that events on the calendar can not overlap each other?

Thanks

zyang91
  • 85
  • 1
  • 6
  • Possible duplicate of [Is there a way to prevent overlapping events in jQuery FullCalendar?](http://stackoverflow.com/questions/2369683/is-there-a-way-to-prevent-overlapping-events-in-jquery-fullcalendar) – Pierre de LESPINAY Dec 12 '15 at 08:49

5 Answers5

5

This option was incorporated since 2.20

eventOverlap: false

http://fullcalendar.io/docs/event_ui/eventOverlap/

el_quick
  • 4,656
  • 11
  • 45
  • 53
5

When selecting you can disabled the overlap:

selectOverlap: false

When you drag&drop:

eventOverlap: false
que1326
  • 2,227
  • 4
  • 41
  • 58
2
var events = $('#calendar').fullCalendar('clientEvents');

// start-time in between any of the events
if(eventStartDay > events[i].start && eventStartDay < events[i].end){
    return true;
}
//end-time in between any of the events
if(eventEndDay > events[i].start && eventEndDay < events[i].end){
    return true;
}
//any of the events in between/on the start-time and end-time
if(eventStartDay <= events[i].start && eventEndDay >= events[i].end){
    return true;
}
MattDMo
  • 100,794
  • 21
  • 241
  • 231
Nidhin Bose J.
  • 1,092
  • 15
  • 28
  • Check those conditions after putting them inside a function and call that function while create/update of an event! I was troubled with the same issue :) Hope it gives atlest some idea. – Nidhin Bose J. Sep 25 '12 at 06:11
0

I guess the easiest way to achieve this is to manipulate the event source. That is if you're using a source that is changeable.

Magnus Winter
  • 921
  • 9
  • 20
0

Following options were helpful imc:

eventOverlap={false}
slotEventOverlap={false}
Shivam Jha
  • 3,160
  • 3
  • 22
  • 36