The onTodayClick event handler fires when the user clicks the "Today" button in the Navigator.
Declaration
DayPilot.Navigator.onTodayClick(args)Parameters
args.preventDefault()- call this method to prevent the Navigator from changing the date to today
Notes
Use args.preventDefault() when you need to handle the button click manually instead of letting the Navigator switch the selection to today.
Examples
JavaScript
const dp = new DayPilot.Navigator("dp", {
showToday: true,
onTodayClick: (args) => {
args.preventDefault();
},
// ...
});
dp.init();Angular
<daypilot-navigator [config]="config"></daypilot-navigator>config: DayPilot.NavigatorConfig = {
showToday: true,
onTodayClick: (args) => {
args.preventDefault();
},
// ...
};React
<DayPilotNavigator
showToday={true}
onTodayClick={onTodayClick}
{/* ... */}
/>const onTodayClick = (args) => {
args.preventDefault();
};Vue
<DayPilotNavigator
:showToday="true"
@todayClick="onTodayClick"
<!-- ... -->
/>const onTodayClick = (args) => {
args.preventDefault();
};See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot