beforeChange

fires before the change of date selection

boolean beforeChange(Date date,Date oldDate,boolean click){ ... };

Parameters

dateDatethe newly selected date
oldDateDatethe previously selected date
clickbooleandefines whether the change happened because of a click on a date (true), or due to an API call (false)

Returns

booleantrue - to allow changing date selection, false - to prevent changing date selection

Example

calendar.events.on("BeforeChange",function(date, oldDate, click){
    if (date > new Date())
        return false;
});

Related samples

Details

You can block selection of particular dates by returning false from the event handler.

See also
Back to top