mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Fix assigning end date to content schedule items
This commit is contained in:
@@ -849,10 +849,10 @@ export function getAllScheduleMatchingGroups (date) {
|
|||||||
if (!cachedScheduleMatchers[matcher.type]) {
|
if (!cachedScheduleMatchers[matcher.type]) {
|
||||||
cachedScheduleMatchers[matcher.type] = makeMatcherClass();
|
cachedScheduleMatchers[matcher.type] = makeMatcherClass();
|
||||||
}
|
}
|
||||||
let end = moment(checkedDate);
|
const end = moment(checkedDate);
|
||||||
end.date(TYPE_SCHEDULE[matcher.type]);
|
end.date(TYPE_SCHEDULE[type]);
|
||||||
if (end.date() <= moment(checkedDate).date()) {
|
if (end.date() <= moment(checkedDate).date()) {
|
||||||
end = moment(end).add(1, 'months');
|
moment(end).add(1, 'months');
|
||||||
}
|
}
|
||||||
cachedScheduleMatchers[matcher.type].end = end.toDate();
|
cachedScheduleMatchers[matcher.type].end = end.toDate();
|
||||||
if (matcher.matcher instanceof Function) {
|
if (matcher.matcher instanceof Function) {
|
||||||
@@ -863,12 +863,8 @@ export function getAllScheduleMatchingGroups (date) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!cachedScheduleMatchers[type]) {
|
if (!cachedScheduleMatchers[type]) {
|
||||||
let end = moment(checkedDate).date(TYPE_SCHEDULE[type]);
|
// No matchers exist for this type
|
||||||
if (end.date() <= checkedDate.date()) {
|
|
||||||
end = moment(end).add(1, 'months');
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
end: end.toDate(),
|
|
||||||
items: [],
|
items: [],
|
||||||
match () {
|
match () {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user