DayPilot.Calendar.onTimeRangeSelecting

 The onTimeRangeSelecting event is fired during time range selecting, on every target position change. You can use it to control the time range shadow appearance and implement custom business rules.

Declaration

DayPilot.Calendar.onTimeRangeSelecting(args)

Parameters

  • args.e - event (DayPilot.Event object) [read-only]
  • args.start - current shadow start (DayPilot.Date) [read-only]
  • args.end - current shadow start (DayPilot.Date) [read-only]
  • args.duration - duration of the selection (DayPilot.Duration)
  • args.resource - current resource id (string | number) [read-only]
  • 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)

Example

dp.onTimeRangeResizing = function(args) {
  args.top.enabled = true;
  args.top.html = "Duration: " + args.duration.totalHours() + " hours";
};