My scheduler has 2 events overlapped with each other. I want to arrange the display priority of the events (which event display in the front or in the back).
I try to sort the events from the priority like this
events[0].seq = 2; // long bar event
events[1].seq = 1; // milestone event
// sort event by seq
events.sort((a, b) => {
if (a.seq < b.seq) return -1;
if (a.seq > b.seq) return 1;
return 0;
});
, but it didn't work.
I want to display milestone event in the front and log bar event in the back.
Is there a way to prioritize the overlapped events display order?