DHTMLX Docs & Samples Explorer

Sensitive range

set calendar sensitive from specified date (2011-07-08)
set calendar sensitive until specified date (2011-07-22)
set calendar sensitive inside specified dates (from 2011-07-08 - until 2011-07-22)
set calendar sensitive out of specified dates (until 2011-07-08 - from 2011-07-22)
clear calendar sensitive data (make all dates sensitive)
Source
<link rel="stylesheet" type="text/css" href="../../codebase/dhtmlxcalendar.css">
    <link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxcalendar_dhx_skyblue.css">
    <script src="../../codebase/dhtmlxcalendar.js"></script>
    <script>
var myCalendar;
function doOnLoad() {
    myCalendar = new dhtmlXCalendarObject("calendarHere");
    myCalendar.hideTime();
    myCalendar.show();
    myCalendar.setDate("2011-07-12");
}
function clearRange() {
    myCalendar.clearSensitiveRange();
}
function setFrom() {
    myCalendar.setSensitiveRange("2011-07-08", null);
    //myCalendar.setInsensitiveRange(null,"2011-07-07"); // the same
    }
function setTo() {
    myCalendar.setSensitiveRange(null, "2011-07-22");
    //myCalendar.setInsensitiveRange("2011-07-23",null); // the same
    }
function setInInterval() {
    myCalendar.setSensitiveRange("2011-07-08", "2011-07-22");
}
function setOutInterval() {
    myCalendar.setInsensitiveRange("2011-07-08", "2011-07-22");
}
</script> <div style="margin-bottom: 20px;"> <table> <tr> <td><input type="button" value="apply" onclick="setFrom();"></td> <td>set calendar sensitive from specified date (2011-07-08)</td> </tr> <tr> <td><input type="button" value="apply" onclick="setTo();"></td> <td>set calendar sensitive until specified date (2011-07-22)</td> </tr> <tr> <td><input type="button" value="apply" onclick="setInInterval();"></td> <td>set calendar sensitive inside specified dates (from 2011-07-08 - until 2011-07-22)</td> </tr> <tr> <td><input type="button" value="apply" onclick="setOutInterval();"></td> <td>set calendar sensitive out of specified dates (until 2011-07-08 - from 2011-07-22)</td> </tr> <tr> <td><input type="button" value="apply" onclick="clearRange();"></td> <td>clear calendar sensitive data (make all dates sensitive)</td> </tr> </table> </div> <div id="calendarHere" style="position:relative;height:250px;"></div>