From 73bfa161a9729c90605dd11bb597685ac13e6847 Mon Sep 17 00:00:00 2001 From: Avris Date: Wed, 18 Aug 2021 18:59:41 +0200 Subject: [PATCH] [calendar] sort events by level --- src/calendar/helpers.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calendar/helpers.js b/src/calendar/helpers.js index ad617ad5..e5abeee0 100644 --- a/src/calendar/helpers.js +++ b/src/calendar/helpers.js @@ -119,5 +119,9 @@ export class Calendar { this.eventsByDate[k].push(event); } } + for (let date in this.eventsByDate) { + if (!this.eventsByDate.hasOwnProperty(date)) { continue; } + this.eventsByDate[date].sort((a, b) => b.level - a.level); + } } }