DayPilot.Calendar.onTimeRangeSelect

The onTimeRangeSelect event is fired when a user completes a time range selection (drag and drop) in the JavaScript Calendar component.

This event is fired before the default action (specified using timeRangeSelectedHandling property). To prevent the default action, you can call args.preventDefault() in the event handler.

When selecting is in progress, the Calendar component fires onTimeRangeSelecting on every change.

Declaration

DayPilot.Calendar.onTimeRangeSelect(args)

Parameters

  • args.control (DayPilot.Calendar) - the calendar component instance

  • args.end (DayPilot.Date object) - end of the selection 

  • args.origin ("click" | "drag" | "api") - origin of the event; "click" is used if the users clicks a grid cell without dragging; available since 2023.2.5592

  • args.resource (string | number) - ID of the selection resource (in the resource calendar mode)

  • args.start (DayPilot.Date object) - start of the selection 

  • args.preventDefault() - prevents the default action and onTimeRangeSelected

Notes

Not available in api=1 mode.

See Also