The onHeaderClick event handler fires when the user clicks a day header in the monthly calendar, before the default action is performed.
DayPilot.Month.onHeaderClick(args)args.header.dayOfWeek (number) - day-of-week index of the clicked header
args.preventDefault() - cancels the default action
In api=1 mode, the legacy signature is onHeaderClick(h), where h.day specifies the day of week.
JavaScript
const month = new DayPilot.Month("dp", {
onHeaderClick: (args) => {
if (args.header.dayOfWeek === 0 || args.header.dayOfWeek === 6) {
args.preventDefault();
}
},
// ...
});
month.init();Angular
<daypilot-month [config]="config"></daypilot-month>config: DayPilot.MonthConfig = {
onHeaderClick: (args) => {
if (args.header.dayOfWeek === 0 || args.header.dayOfWeek === 6) {
args.preventDefault();
}
},
// ...
};React
<DayPilotMonth
onHeaderClick={onHeaderClick}
{/* ... */}
/>const onHeaderClick = (args) => {
if (args.header.dayOfWeek === 0 || args.header.dayOfWeek === 6) {
args.preventDefault();
}
};Vue
<DayPilotMonth
@headerClick="onHeaderClick"
<!-- ... -->
/>const onHeaderClick = (args) => {
if (args.header.dayOfWeek === 0 || args.header.dayOfWeek === 6) {
args.preventDefault();
}
};