Fix assigning end date to content schedule items

This commit is contained in:
Phillip Thelen
2024-04-23 14:40:10 +02:00
parent b0a4ed30d4
commit 80a212683d

View File

@@ -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;