Limit events per day

Hello everyone!

Is possible to limit that events start and end on the same day? I mean, I don’t want events from one day to another, just events which starts and ends in the same day.

Is any property available or should I do through onEventSave/onBeforeUpdate validation?

Thanks for your help.

As far as I can see - there is no such option, you can use onEventSave handler, which will fire before event saving, and from it check and modify end_date of newly created event

Thanks Stanislav,

In that case I will use JS:

if (data.end_date.getFullYear() != data.start_date.getFullYear() || data.end_date.getMonth() != data.start_date.getMonth() || data.end_date.getDate() != data.start_date.getDate()) { dhtmlx.message("Events must start and end on the same day!"); return false; } return true;