From 75dbe671677565505b1e261d295dd7c87bdf566f Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Fri, 3 Jan 2025 12:10:29 -0600 Subject: [PATCH] Fix calendar clipping before broadcast (#3679) -fixes #3678 --- CHANGELOG.md | 2 ++ modules/default/calendar/calendar.js | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b58882f6d..b2410a560c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ planned for 2025-04-01 ### Fixed +- [calendar] fix clipping events being broadcast (#3678) + ## [2.30.0] - 2025-01-01 Thanks to: @xsorifc28, @HeikoGr, @bugsounet, @khassel, @KristjanESPERANTO, @rejas, @sdetweil. diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index c97f353e32..2610b23939 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -692,9 +692,13 @@ Module.register("calendar", { by_url_calevents.sort(function (a, b) { return a.startDate - b.startDate; }); - Log.debug(`pushing ${by_url_calevents.length} events to total with room for ${remainingEntries}`); - events = events.concat(by_url_calevents.slice(0, remainingEntries)); - Log.debug(`events for calendar=${events.length}`); + if (limitNumberOfEntries) { + Log.debug(`pushing ${by_url_calevents.length} events to total with room for ${remainingEntries}`); + events = events.concat(by_url_calevents.slice(0, remainingEntries)); + Log.debug(`events for calendar=${events.length}`); + } else { + events = events.concat(by_url_calevents); + } } Log.info(`sorting events count=${events.length}`); events.sort(function (a, b) {