I do not know if this is the case, but I hope it helps. I use fullcalendar by primeng in an Angular project. For the event in question I call a function:
(onEventDrop)="reschedule($event)"
And my role:
reschedule(event) {
if ((addHours(event.event.start._d, 3).getTime() > addHours(new Date(), 1).getTime())) { //
if (this.notHaveConflicts(addHours(event.event.start._d, 3), addHours(event.event.end._d, 3), event.event.id)) {
// console.log('nao');
this.event = event.event;
this.event.startdb = this.dateToStringDB(addHours(event.event.start._d, 3));
this.event.enddb = this.dateToStringDB(addHours(event.event.end._d, 3));
this.event.status = 3;
this.event.cancel_reason = result.reason;
delete this.event.source;
// console.log(this.event);
this.toggle_events = this._eventsService.updateEvent(this.event).subscribe(
response => {
if (response.return) {
// evento atualizado
} else {
// erro no banco/API
event.revertFunc();
}
},
err => {
// erro no banco
event.revertFunc();
}
);
this.reRender();
} else {
// teve conflito
event.revertFunc();
}
} else {
event.revertFunc();
this._toastrService.error(this._translateService.instant('Agenda.IntervalError'),
this._translateService.instant('Error.Err'));
}
}
In this project, the event is between 2 people, so I check the schedules in the API, if they collide, I call the function:
revertFunc();
And my event returns to the exact place where it was. The fullcalendar itself already holds the previous location to go back, so in my case it was just call it that worked! = D
I hope I have helped!