Skip to main content

disabledDates

allows disabling some date intervals, day labels are dimmed

disabledDates?: (a: Date) => boolean;

Example

var calendar = new dhx.Calendar("calendar", {
disabledDates: function(date) {
var disabled = {
0: true,
1: true,
2: false,
3: false,
4: false,
5: false,
6: true
}
return disabled[date.getDay()];
}
});

Related sample: Calendar. Disabled Dates

The function passed to the method receives one parameter:

  • date (Date) - a date object

and must return a boolean value to define whether a passed date should be blocked (if true, the date is inactive).

Change log:

added in v6.4