From 26c31bcc041ac10880a1ab335a6e4bb33d3e343b Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Mon, 2 Jul 2018 17:27:09 +0200 Subject: [PATCH] [Bugfix] Fix the ordering of events They were in SQL order. Now they are ordered by start time. --- calsocial/calendar_system/gregorian.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/calsocial/calendar_system/gregorian.py b/calsocial/calendar_system/gregorian.py index 061fdbc..b9dd802 100644 --- a/calsocial/calendar_system/gregorian.py +++ b/calsocial/calendar_system/gregorian.py @@ -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