DHTMLX Docs & Samples Explorer

setHolidays(date)

Sets date(s) as holiday(s).

Parameters:

  • date - the date(s) you want to set as holiday(s).
    Should be specified in one of the following formats: '%Y-%m-%d' or '%Y.%m.%d'.

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