block

allows disabling some date intervals, day labels are dimmed

function block;

Deprecated

instead of it, you can use the disabledDates property:

var disabledDates = [ new Date(2019,0,8), new Date(2019,0,10) ];
 
var calendar = new dhx.Calendar("calendar_container",{
    disabledDates : function(date) {
        return date > disabledDates[0] && date < disabledDates[1];
    }
});

Example

var block = [ new Date(2019,0,8), new Date(2019,0,10) ];
 
var calendar = new dhx.Calendar("calendar_container",{
    block : function(date) {
        return date > block[0] && date < block[1];
    }
});

Related samples

Details

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).

See also
Back to top