[Bugfix] Fix the ordering of events

They were in SQL order.  Now they are ordered by start time.
This commit is contained in:
Gergely Polonkai 2018-07-02 17:27:09 +02:00
parent 32c84725a9
commit 26c31bcc04

View File

@ -154,6 +154,7 @@ class GregorianCalendar(CalendarSystem):
end_timestamp = start_timestamp + timedelta(days=1)
events = events.filter(((Event.start_time >= start_timestamp) & (Event.start_time < end_timestamp)) |
((Event.end_time >= start_timestamp) & (Event.end_time < end_timestamp)))
((Event.end_time >= start_timestamp) & (Event.end_time < end_timestamp))) \
.order_by('start_time', 'end_time')
return events