checks whether a date is a holiday

function isHoliday;


  view: "gantt",
  url: "",
  // switch off all holidays
  isHoliday: date => false


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).

  view: "gantt",
  url: "",
  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