Is there a way to prevent overlapping events in jQuery FullCalendar?

前端 未结 10 2100
伪装坚强ぢ
伪装坚强ぢ 2020-12-01 03:47

Is there a way to prevent overlapping events in jQuery FullCalendar?

10条回答
  •  渐次进展
    2020-12-01 04:15

    Same as ecruz's answer but with logic that worked better for me.

    function isOverlapping(event){
        // "calendar" on line below should ref the element on which fc has been called 
        var array = calendar.fullCalendar('clientEvents');
        for(i in array){
            if (event.end >= array[i].start && event.start <= array[i].end){
               return true;
            }
        }
        return false;
    }
    

提交回复
热议问题