need to know whether I drag and drop to a different time date, on the eventDragStop callback fuction of the fullcalendar

36 Views Asked by At

In the fullcalendar scheduler, I need the eventDragStop to execute a call back function, ONLY when the user drag and drop to the same date time, while do not execute anything if the user drag and drop to a different time zone.

The code snippet is below:

   eventDragStop: function(event, jsEvent, ui, view) { ... }

I cannot get another information on whether the user drag and drop to the same or different date time.

1

There are 1 best solutions below

0
Midhun On

For your question i think we need to setup a callback function, which will be triggered when the dragEvent stops and then verify the value dragged event. To setup this we need to configure calendarOptions as

public calendarOptions: CalendarOptions = {
        //your normal settings here,
        eventDragStop: this.eventDragStop.bind(this),
};

then

 eventDragStop(arg: EventDragStopArg): void {
     //arg?.jsEvent?.clientX
     //arg?.jsEvent?.clientY
 }

can write any logic you want inside the eventDragStop and make use of the EventDragStopArg model as needed. also if it concerned of dragging to a outside element, its better to fine the offset of those element and compare as needed.

Hope this helps :)