The onTodayClick event handler fires when the user clicks the "Today" button in the Navigator.
DayPilot.Navigator.onTodayClick(args)args.preventDefault() - call this method to prevent the Navigator from changing the date to today
Use args.preventDefault() when you need to handle the button click manually instead of letting the Navigator switch the selection to today.
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();
};