Hello,
I am using Scheduler(v4.3.6 ). I'm trying to implement the functionality of moving the events. The objective of this functionality is to move an event from one resource to another resource under the condition that the target time range is not occupied by another event.
One important point is to check whether the target time range is used by other events in the same "resource". To do that, I have to predict the endDate of the moving event before it's actually dropped. The problem that I'm facing is that I don't know how to get the "endDate" of the event with the "startDate", "duration" and the working time. I found "context['endDate']" in the function
"beforeEventDropFinalize({context, source})",
however, it doesn't consider the not working time in the scheduler.
Could someone please tell me how to calculate the "endDate" with "startDate", "duration", and the calendar in the function "beforeEventDropFinalize" and "beforeEventSave" of scheduler? Is there a function in the plugin that allows doing this?
And is there a function to check whether the time range is used by the other events?
For more context, here's an example, in the attachment, there are two events(event 1 et event2), two resources( "PRESSE S1,"PRESSE S2" ), calendar(every weekday from 7:00 to 18:00).
I want to drag the event 1 from ressource "PRESSE S1" to ressource "PRESSE S2". In the background of my application, resource "PRESSE S1" can take different events in the same time range. But for the resource "PRESSE S2" doesn't allow different events in the same time range, which means a time range is exclusively allocated to one event. If I want to drop the event to resource "PRESSE S2", it needs to check whether the new time range to place "event 1" isn't used by the others events in the function " beforeEventDropFinalize".
Thank you in advance.