Skip to content

onEventLeave

Hears an event of this calendar dragged onto another calendar.

Type(leave: EventLeave) => void
Defaultnot set
Live update (update())Yes
Declared inpackages/dom/src/settings.ts

It receives { event, to, revert() }: the event as it was here, the other calendar’s view element (to.closest('.dz-cal') for the calendar), and revert(), which takes both sides back — the event here again, gone from there — or neither, returning false, when either side changed since. Two calendars on one store share the event: a drag between them is a move, and this is not called. The other calendar hears onEventReceive; persist the move once, from one side.

import { createCalendar } from '@dzcalendar/dom';
createCalendar(element, {
timeZone: 'Europe/Paris',
editable: true,
onEventLeave: (leave) => console.log(`${leave.event.title} went to another calendar`),
});

In the frameworks it is an output: Angular’s (eventLeave), React’s onEventLeave, Vue’s @event-leave.