From c0d915f2e3ac2d13c422e29f54e2614882b64763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Wed, 5 Aug 2020 12:08:27 +0200 Subject: [PATCH] Order daily summary view (#177) --- server/mscalendar/views/calendar.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/mscalendar/views/calendar.go b/server/mscalendar/views/calendar.go index ad4a18b5..cdd19f44 100644 --- a/server/mscalendar/views/calendar.go +++ b/server/mscalendar/views/calendar.go @@ -21,6 +21,10 @@ func RenderCalendarView(events []*remote.Event, timeZone string) (string, error) } } + sort.Slice(events, func(i, j int) bool { + return events[i].Start.Time().Before(events[j].Start.Time()) + }) + resp := "Times are shown in " + events[0].Start.TimeZone for _, group := range groupEventsByDate(events) { resp += "\n" + group[0].Start.Time().Format("Monday January 02") + "\n\n"