简体   繁体   English

fullCalendar v5 eventOverlap 资源

[英]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? eventOverlap function 中是否有任何方法可以获取 StillEvent 和 MovingEvent resourceId,其中每个事件都是重叠时刻的位置?

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.如果重叠在同一资源中,那么我需要返回 false,否则我将返回 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演示: 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.注意,您不能使用 eventOverlap 比较不同资源中的事件,因为如果将事件拖到与另一个资源中的事件重叠的特定时间段,则不会触发eventOverlap回调 - 正如我上面所说,fullCalendar 不考虑这一点成为潜在的重叠。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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