The onEventMoving event is fired by the JavaScript Calendar component during event moving, on every target position change. You can use it to control the moving shadow appearance and implement custom business rules.
DayPilot.Calendar.onEventMoving(args)
args.e - event (DayPilot.Event object) [read-only]
args.start - current shadow start (DayPilot.Date); since 2024.2.5922 the value can be modified
args.end - current shadow start (DayPilot.Date); since 2024.2.5922 the value can be modified
args.resource - current resource id (string | number); since 2024.2.5922 the value can be modified
args.html - shadow HTML (string)
args.cssClass - shadow CSS class (string)
args.allowed - enabled/disable drop at this position (boolean)
args.top.width - width of the "top" text, null for auto (number)
args.top.space - distance of the "top" text from the shadow in pixels (number)
args.top.html - "top" HTML (string)
args.top.enabled - enable/disabled "top" text (boolean)
args.bottom.width - width of the "bottom" text, null for auto (number)
args.bottom.space - distance of the "bottom" text from the shadow in pixels (number)
args.bottom.html - "bottom" HTML (string)
args.bottom.enabled - enable/disabled "bottom" text (boolean)
Calendar config:
{
onEventMoving: (args) => {
args.html = "Moving '" + args.e.text() + "' to " + args.start.toString("MMMM d, yyyy @ h:mm tt");
}
}