简体   繁体   中英

fullCalendar v5 eventOverlap resource

I'm trying to check if events are overlaping at same resource.

Is there any way in eventOverlap function to get stillEvent and movingEvent resourceId where each event are positiones at overlapping moment?

I tried this but everything is undefined:

eventOverlap: function (stillEvent, movingEvent) {
        console.log(stillEvent.resource);
        console.log(movingEvent.resource);
        console.log(stillEvent.resourceId);
        console.log(movingEvent.resourceId);
}

If overlapping is in same resource then i need to return false, else i will return true.

To achieve what you want you can just set

eventOverlap: false

This will stop events in the same resource being allowed to overlap. Events which are in another resource are already considered as not (potentially) overlapping.

Demo: https://codepen.io/ADyson82/pen/PoZeov

NB you cannot use eventOverlap to compare events in different resources, because the eventOverlap callback will not be triggered if an event is dragged onto a specific time period which overlaps with an event in another resource - as I said above, this is not considered by fullCalendar to be a potential overlap.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM