DayPilot.Calendar.getSelection

The getSelection() method returns the current time range selection.

Declaration

DayPilot.Calendar.getSelection()

Return Value

Returns a DayPilot.Selection object with the following properties:

  • start (DayPilot.Date) - selection start

  • end (DayPilot.Date) - selection end

  • resource (string) - resource ID if specified for the column; otherwise null

If no range is selected, it returns null.

Example

const calendar = new DayPilot.Calendar("dp", {
  // ... config
});
calendar.init();

const selection = calendar.getSelection();

See Also

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript