Is there a way to prevent overlapping events in jQuery FullCalendar?
I'm using version 2.11 of Fullcalendar and i made some change to code posted by ecruz:
function isOverlapping(event){
var array = calendar.fullCalendar('clientEvents');
for(i in array){
if(array[i]._id != event._id){
if(!(array[i].start.format() >= event.end.format() || array[i].end.format() <= event.start.format())){
return true;
}
}
}
return false;
}
and this is how i use to prevent the overlap:
$('#calendar').fullCalendar({
...
eventDrop: function(event, delta, revertFunc) {
if (isOverlapping(event)) {
revertFunc();
}
},
...
});