The addNavigator() method adds a date picker component to the switching logic.
Use this method as an alternative to setting options.navigator in the DayPilot.Switcher Constructor.
DayPilot.Switcher.addNavigator(nav)nav (DayPilot.Navigator) - linked date picker instance
const nav = new DayPilot.Navigator("nav", {
// ...
});
nav.init();
const day = new DayPilot.Calendar("dpDay", {
// ...
});
day.init();
const week = new DayPilot.Calendar("dpWeek", {
// ...
});
week.init();
const switcher = new DayPilot.Switcher({
triggers: [
{ id: "buttonDay", view: day },
{ id: "buttonWeek", view: week },
],
});
switcher.addNavigator(nav);