Is it possible to validate an event duration. In my application it must be no longer than 36 hours.
I tried this, but it does not work:
dhx.dp($$(“scheduler”)).attachEvent(“onEventSave”, function(id, data) {
// in milliseconds
var duration = Math.abs(data.end_date - data.start_date);
// in hours
duration = duration / (1000 * 60 * 60);
if (duration > 36) {
alert(‘An event cannot be longer than 36 hours.’);
return false;
}
return true;
});