DHTMLX Docs & Samples Explorer

setHolidays(date)

Sets date(s) as holiday(s).

Parameters:

  • date - the date(s) you want to set as holiday(s). Date object or string in current format (or array with dates), if null - clear all holidays. If the date is set as a string, it should correspond to the format specified with the setDateFormat(format) method.

    myCalendar.setHolidays("2011-09-25"); // sets September 25, 2011 as holiday

Description:

There are 7 different ways to call the method:

// sets a single holiday
myCalendar.setHolidays("2011-06-01");
 
// or
myCalendar.setHolidays(new Date(2011,5,1));
 
// sets several holidays
myCalendar.setHolidays(["2011-06-01,2011-06-02,2011-06-03"]);
 
// or
myCalendar.setHolidays(["2011-06-01","2011-06-02,2011-06-03"]);
 
// or
myCalendar.setHolidays(["2011-06-01","2011-06-02","2011-06-03"]);
 
// or
myCalendar.setHolidays([new Date(2011,5,1),"2011-06-02,2011-06-03"]);
 
// clears all holidays
myCalendar.setHolidays(null);

i.e. you can pass single date or array with dates as param, each single date can be 2+ dates coma-separated, date object also allowed.