DHTMLX Docs & Samples Explorer

onBeforeChange

Fires before the user starts to change month, year or time in the selector

myCalendar.attachEvent("onBeforeChange",function(date){
    alert("Date will be set to "+date);
    return true;
});
 
// for double calendar
myCalendar.attachEvent("onBeforeChange",function(side, date){
    // your code here
    return true;
});

Parameters of handler function:

  • side - (string) “left” or “right”, specify calendar where event was fired, double-calendar only
  • date - the selected date

Description:

  • If the handler function returns 'false', a user won't be allowed to change date in calendar, i.e. the current date will be selected all the time