Check documentation for the latest version of dhtmlxSuite disableDays DHTMLX Docs

disableDays

disables certain dates of each week, month or year

void disableDays(string mode,string|number|array date);
modestring"week", "month", "year"
datestring|number|arraydates you want to make inactive
Details

1) week mode, 2nd param - numbers from 1 to 7, 1 relates to Monday, 7 - to Sunday

// disables every Monday of each week in the calendar
myCalendar.disableDays("week", 1);
 
// disables every Monday and Tuesday of each week in the calendar
myCalendar.disableDays("week", [1, 2]);


2) month mode, 2nd param - numbers from 1 to 31, appropriate day of the month

// disables 1st day of each month
myCalendar.disableDays("month", 1);
 
// disables 1st, 2nd, 5th, 6th and 19th day of each month
myCalendar.disableDays("month", [1, 2, 5, 6, 19]);


3) year mode, 2nd param - Date Object or string, year not affected on script logic

// disables the 1st of January of each year in the calendar
myCalendar.disableDays("year", "2011-01-01");
 
// disables the 1st and the 2nd of January of each year in the calendar 
myCalendar.disableDays("year", ["2011-01-01", "2011-01-02"]);


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

See also
Back to top