The select() method selects the specified date in the Navigator date picker component.
Automatic selection:
DayPilot.Navigator.select(date[, options])Free-hand selection (available since 2022.2.5270):
DayPilot.Navigator.select(start, end[, options])date (DayPilot.Date or ISO 8601 string) - date to be selected
start (DayPilot.Date or ISO 8601 string) - selection start date
end (DayPilot.Date or ISO 8601 string) - selection end date
options (object) - custom options object; optional
The options object supports the following properties:
dontFocus (boolean) - set to true if you do not want the Navigator to autofocus and change the visible range according to the selected date
dontNotify (boolean) - set to true if you do not want DayPilot.Navigator.onTimeRangeSelect and DayPilot.Navigator.onTimeRangeSelected to fire
The selected date will be extended according to the current DayPilot.Navigator.selectMode.
If you want to specify custom selection start and end dates, DayPilot.Navigator.freeHandSelectionEnabled must be set to true.
If the new date or range is within the currently visible range, the visible range will be updated.
DayPilot.Navigator.onVisibleRangeChanged fires if it is necessary to update the visible range.
DayPilot.Navigator.onTimeRangeSelected fires if the selection changes.
Select a date using automatic selection:
const nav = new DayPilot.Navigator("dp", {
// ...
});
nav.init();
nav.select("2026-03-15");Select a custom range using free-hand selection:
const nav = new DayPilot.Navigator("dp", {
freeHandSelectionEnabled: true,
// ...
});
nav.init();
nav.select("2026-03-15", "2026-03-18", {
dontNotify: true
});DayPilot.Navigator.freeHandSelectionEnabled
DayPilot.Navigator.onTimeRangeSelect
DayPilot.Navigator.onTimeRangeSelected