isHoliday

checks whether a date is a holiday

function isHoliday;

Example

webix.ui({
  view: "gantt",
  url: "https://docs.webix.com/gantt-backend/",
  // switch off all holidays
  isHoliday: date => false
});

Details

The function is called for each day on the scale and returns true if a day is a holiday. It takes the only argument:

  • date (object) - JS Date object.

By default Sunday and Saturday are marked as holidays. Here is an example of how you can define custom holidays (Sunday, Saturday and every 4th of November).

webix.ui({
  view: "gantt",
  url: "https://docs.webix.com/gantt-backend/",
  isHoliday: date => {
    const d = date.getDay();
    return (
      // JS days array is zero-based
      d === 0 ||
      d === 6 ||
      (date.getDate() === 4 && date.getMonth() === 10)
    );
  }
});

Related sample:  Gantt: Custom Holidays

See also
Back to top