DHTMLX Docs & Samples Explorer

setSensitiveRange(dateFrom, dateTo)

Sets a range of active dates in calendar. Other dates will be inactive (dimmed).

Parameters:

  • dateFrom and dateTo - date from and date to, can be string in corrent format, Date object or null (null means inf). If the date is set as a string, it should correspond to the format specified with the setDateFormat(format) method.

    setSensitiveRange("2011-07-08", null); // all dates starting from July 08, 2011 will be active. Dates until July 08, 2011 will be dimmed.

Description:

There are 3 different ways to call this method:

// sets a range of active dates. Dates out of this range are disabled.
myCalendar.setSensitiveRange(from, to);
 
// sets a range of active dates from the specified date (inclusive). Dates until the specified date are disabled.
myCalendar.setSensitiveRange(from, null);
 
// sets a range of active dates until the specified date (inclusive). Dates after the specifies date are disabled.
myCalendar.setSensitiveRange(null, to);

For example:

// just 1st June 2011, 2nd June 2011 and 3rd June 2011 will be active. All the other dates will be disabled.
myCalendar.setSensitiveRange("2011-06-01", "2011-06-03");
 
// all dates until 1st June 2011 (inclusive) will be active. Dates after 1st June 2011 will be dimmed.
myCalendar.setSensitiveRange(null, "2011-06-01");

See also: