mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 07:18:38 +00:00
Fix assigning end date to content schedule items
This commit is contained in:
parent
b0a4ed30d4
commit
80a212683d
1 changed files with 4 additions and 8 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue