DayPilot.Month.onHeaderClick

The onHeaderClick event handler fires when the user clicks a day header in the monthly calendar, before the default action is performed.

Declaration

DayPilot.Month.onHeaderClick(args)

Parameters

  • args.header.dayOfWeek (number) - day-of-week index of the clicked header

  • args.preventDefault() - cancels the default action

Notes

In api=1 mode, the legacy signature is onHeaderClick(h), where h.day specifies the day of week.

Examples

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();
  }
};

See Also

DayPilot.Month Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript