diff --git a/CHANGELOG.md b/CHANGELOG.md index b9a2f447..95bb36b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ _This release is scheduled to be released on 2022-01-01._ - Fixed Calendar recurring cross timezone error (add/subtract a day, not just offset hours) (#2632) - Fixed Calendar showEnd and Full Date overlay (#2629) - Fixed regression on #2632, #2752 +- Broadcast custom symbols in CALENDAR_EVENTS ## [2.17.1] - 2021-10-01 diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index c13196f1..52bb87da 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -237,18 +237,6 @@ Module.register("calendar", { symbolWrapper.className = "symbol align-right " + symbolClass; const symbols = this.symbolsForEvent(event); - // If symbols are displayed and custom symbol is set, replace event symbol - if (this.config.displaySymbol && this.config.customEvents.length > 0) { - for (let ev in this.config.customEvents) { - if (typeof this.config.customEvents[ev].symbol !== "undefined" && this.config.customEvents[ev].symbol !== "") { - let needle = new RegExp(this.config.customEvents[ev].keyword, "gi"); - if (needle.test(event.title)) { - symbols[0] = this.config.customEvents[ev].symbol; - break; - } - } - } - } symbols.forEach((s, index) => { const symbol = document.createElement("span"); symbol.className = "fa fa-fw fa-" + s; @@ -640,6 +628,17 @@ Module.register("calendar", { symbols = this.mergeUnique(this.getCalendarPropertyAsArray(event.url, "fullDaySymbol", this.config.defaultSymbol), symbols); } + // If custom symbol is set, replace event symbol + for (let ev of this.config.customEvents) { + if (typeof ev.symbol !== "undefined" && ev.symbol !== "") { + let needle = new RegExp(ev.keyword, "gi"); + if (needle.test(event.title)) { + symbols[0] = ev.symbol; + break; + } + } + } + return symbols; },