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 startend(DayPilot.Date) - selection endresource(string) - resource ID if specified for the column; otherwisenull
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:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot