vkurko / calendar

Full-sized drag & drop JavaScript event calendar with resource & timeline views
https://vkurko.github.io/calendar/
MIT License
969 stars 82 forks source link

Preventing Event Overlap #150

Closed csonic656 closed 11 months ago

csonic656 commented 11 months ago

I really like this calendar, but I have a particularly specific use case for it. I was wondering if it would be possible to prevent events from overlapping, or perhaps once overlapped, combine the two events, particularly in the timeGridWeek view? Also, would it be possible to prevent events from being drag created into multiple days?

vkurko commented 11 months ago

If I understand you correctly, then overlapping events shouldn't happen during dragging? The only way to control this in your case is to use the eventDrop hook. Inside the hook, you can check if the conditions are met and then cancel the drag by calling the revert method.

vkurko commented 11 months ago

I hope I can close this issue.