add end date to more items/categories

This commit is contained in:
Phillip Thelen
2024-05-03 11:12:00 +02:00
parent eacf6de19a
commit dac792dd27
2 changed files with 6 additions and 5 deletions

View File

@@ -875,7 +875,7 @@ function makeEndDate (checkedDate, matcher) {
end.date(TYPE_SCHEDULE[matcher.type]);
if (matcher.endMonth !== undefined) {
end.month(matcher.endMonth);
} else if (end.date() <= moment(checkedDate).date()) {
} else if (end.date() <= checkedDate) {
end = moment(end).add(1, 'months');
}
return end.toDate();
@@ -895,7 +895,7 @@ export function getAllScheduleMatchingGroups (date) {
cachedScheduleMatchers = {};
assembleScheduledMatchers(checkedDate).forEach(matcher => {
if (!cachedScheduleMatchers[matcher.type]) {
cachedScheduleMatchers[matcher.type] = makeMatcherClass(date);
cachedScheduleMatchers[matcher.type] = makeMatcherClass(checkedDate);
}
cachedScheduleMatchers[matcher.type].end = makeEndDate(checkedDate, matcher);
if (matcher.matcher instanceof Function) {