Check documentation for the latest version of dhtmlxSuite setHolidays DHTMLX Docs

setHolidays

set dates as holidays

void setHolidays(Date|string|array date);
dateDate|string|arraydates you want to set as holidays, if null - clears all holidays

Example

// sets September 25, 2011 as a holiday
myCalendar.setHolidays("2011-09-25"); 
 
// 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);

Details

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

If the date is set as a string, it should correspond to the format specified by the setDateFormat() method

Back to top