Thank you for contacting Syncfusion support.
When two or more appointments are created with the same duration, the appointments are sorted based on the appointment’s Guid internally before rendering, since Guid of the appointments are unique and random, appointments will be sorted randomly which is the cause for the issue. We have prepared the sample to sort the same duration appointments based on its Subject which can be viewed from the below link.
<Code>
ej.Schedule.prototype._appointmentSort = function (appointments) { // here internal sorting function is overridden
var proxy = this;
if (this.currentView() == "agenda") {
appointments.sort(function (a, b) {
var d1 = a[proxy._appointmentSettings["startTime"]];
var d2 = b[proxy._appointmentSettings["startTime"]];
var d3 = a[proxy._appointmentSettings["endTime"]];
var d4 = b[proxy._appointmentSettings["endTime"]];
return d1.getTime() - d2.getTime() || d3.getTime() - d4.getTime();
});
}
else if (this.currentView() != "day") {
appointments.sort(function (a, b) {
var d1 = a[proxy._appointmentSettings["endTime"]] - a[proxy._appointmentSettings["startTime"]];
var d2 = b[proxy._appointmentSettings["endTime"]] - b[proxy._appointmentSettings["startTime"]];
var date1 = new Date(a[proxy._appointmentSettings["startTime"]]);
var date2 = new Date(b[proxy._appointmentSettings["startTime"]]);
var date3 = new Date(a[proxy._appointmentSettings["endTime"]]);
var date4 = new Date(b[proxy._appointmentSettings["endTime"]]);
var d3 = a[proxy._appointmentSettings["startTime"]];
var d4 = b[proxy._appointmentSettings["startTime"]];
if (date1 == date2 && date3 == date4)
return d3 - d4 || a.Subject.localeCompare(b.Subject);
else if (date1 - date2 == 0)
return d2 - d1 || d3 - d4 || a.Subject.localeCompare(b.Subject);
else
return d3 - d4 || a.Subject.localeCompare(b.Subject);
});
}
else {
appointments.sort(function (a, b) {
var d3 = a[proxy._appointmentSettings["startTime"]];
var d4 = b[proxy._appointmentSettings["startTime"]];
var d1 = a[proxy._appointmentSettings["endTime"]] - a[proxy._appointmentSettings["startTime"]];
var d2 = b[proxy._appointmentSettings["endTime"]] - b[proxy._appointmentSettings["startTime"]];
return d3 - d4 || d2 - d1 || a.Subject.localeCompare(b.Subject);
});
}
return appointments;
}
</Code>
Regards,
Karthigeyan