FullCalendar Multiple Calendars Not Ordering Correctly

738 views Asked by At

I am having issues with multiple calendars bringing data in to my FullCalendar.

Is there any functionality that allows calendar events to be ordered chronologically by start time (i.e. 9am start showing above 10am start) and this functionality being maintained across the different calendars?

At present, it appears that my events are being displayed at random and grouped within the separate calendars.

I've attached a screenshot of the outcome, and would appreciate any ideas as to what could be causing this seemingly random output of data and how I can fix it in a way that is logical to the user.

https://i.stack.imgur.com/hKelo.jpg

1

There are 1 answers

3
VisualBean On

eventOrder 2.4.0

Determines the vertical ordering events that have the same dates / times.

String / Array / Function, default: "title"

By default, FullCalendar decides that events with longer durations and earlier start times are sorted above other events. However, events often have the same exact start time and duration, which is especially true for all-day events. By default, when this happens, events are sorted alphabetically by title. eventOrder provides the ability to override this behavior.

This setting accepts a few different arguments:

  • a name of an Event Object property, like "title". This can be the name of a non-standard field. Sorting will happen in ascending order. If prefixed with a minus sign like "-title", sorting will happen in descending order.

  • a comma-separated string of property names, like "title,propA,-propB"

  • a function that accepts two arguments and returns -1 or 1, similar to sort's compare function.

  • an array of property names and functions like [ "title", "-propA", myFunc ].

http://fullcalendar.io/docs/event_rendering/eventOrder/