How eventOrder works?

I want to sort events based on a particular field - say studentID.

But from the doc, I saw the below:

eventOrder: function (event) {
return event.accepted ? 1 : -1;
},

I can’t understand how exacty I can use my event.studentID to sort the events…

Because from the argument I receive only one event.

So to sort in any order(ascending/descending), I need to compare 2 events.

So I can’t understand how exactly I can use the eventOrder for arranging my events based on event.studentID field.

Kindly provide some insights!

Hi there,

The eventOrder function accepts two event objects as arguments, so you can do the following:

eventOrder: function (event1, event2) {
    return event1.collegeID > event2.studentID? 1 : -1;
}