Thank you for contacting Syncfusion support.
We have prepared the sample to prevent the rendering of an appointment in the time range of an already rendered appointments which can be download from the below location.
In the sample, initially two appointment will render in same day and same time. When 3rd appointment is created in already rendered appointment interval range it will not be created. Kindly refer the below code example used in the sample.
<Code>
function onBeforeAppointmentCreate(args) { // this function will be called before saving an app
var curApps = (ej.isNullOrUndefined(args.appointment[0])) ? args.appointment : args.appointment[0];
var proxy = this, _appList = this._processed, appointmentsList = [], app = [], appList = [], overlapList = [];
appointmentsList = _appList.filter(function (obj) { return obj[proxy._appointmentSettings["endTime"]] > curApps[proxy._appointmentSettings["startTime"]] && obj[proxy._appointmentSettings["startTime"]] < curApps[proxy._appointmentSettings["endTime"]]; });
appointmentsList.forEach(function (obj) {
appList = _appList.filter(function (list) { return list[proxy._appointmentSettings["endTime"]] >= new Date(obj[proxy._appointmentSettings["startTime"]]) && list[proxy._appointmentSettings["startTime"]] <= new Date(obj[proxy._appointmentSettings["endTime"]]); });
var collection = $(appList).not(appointmentsList);
if (collection.length != 0) app = $.merge(app, collection);
return app;
});
overlapList = $.merge(appointmentsList, app);
args.cancel = (overlapList.length > 1);
}
</Code>
Regards,
Karthigeyan