DHTMLX Docs & Samples Explorer

setSensitiveRange(date)

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

Parameters:

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

    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 (inclusive). 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);

where 'from', 'to' parameters can be either an object or a string.

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: