Hi,
I’m trying to add an event for validating the dates and that the event title won’t be empty before adding it.
But this code isn’t working for me.
Thanks
[code] $$(“scheduler”).data.attachEvent(“onBeforeAdd”,function(id){
var current_date = new Date();
if(this.item(id).start_date > this.item(id).end_date){
dhx.alert("Start Date should be less than End date");
return false; // event won't be saved, user can fix start date
}
if(this.item(id).start_date < current_date){
dhx.alert("Start Date with time should not be less than current date with time.");
return false;
}
retrun true; // default action, event will be saved
});[/code]