From 80a212683dc806c231137e7b4bfa85e2fde81d08 Mon Sep 17 00:00:00 2001 From: Phillip Thelen Date: Tue, 23 Apr 2024 14:40:10 +0200 Subject: [PATCH] Fix assigning end date to content schedule items --- website/common/script/content/constants/schedule.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/website/common/script/content/constants/schedule.js b/website/common/script/content/constants/schedule.js index b755ca1d50..a8b7f671b9 100644 --- a/website/common/script/content/constants/schedule.js +++ b/website/common/script/content/constants/schedule.js @@ -849,10 +849,10 @@ export function getAllScheduleMatchingGroups (date) { if (!cachedScheduleMatchers[matcher.type]) { cachedScheduleMatchers[matcher.type] = makeMatcherClass(); } - let end = moment(checkedDate); - end.date(TYPE_SCHEDULE[matcher.type]); + const end = moment(checkedDate); + end.date(TYPE_SCHEDULE[type]); if (end.date() <= moment(checkedDate).date()) { - end = moment(end).add(1, 'months'); + moment(end).add(1, 'months'); } cachedScheduleMatchers[matcher.type].end = end.toDate(); if (matcher.matcher instanceof Function) { @@ -863,12 +863,8 @@ export function getAllScheduleMatchingGroups (date) { }); } if (!cachedScheduleMatchers[type]) { - let end = moment(checkedDate).date(TYPE_SCHEDULE[type]); - if (end.date() <= checkedDate.date()) { - end = moment(end).add(1, 'months'); - } + // No matchers exist for this type return { - end: end.toDate(), items: [], match () { return true;