Skip to content

Commit

Permalink
move else
Browse files Browse the repository at this point in the history
  • Loading branch information
shall0pass committed Dec 18, 2023
1 parent 06c353e commit 2b1d2ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/loot-core/src/server/budget/goals/goalsSchedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ async function createScheduleList(template, current_month) {
);
// const startDate = dateConditions.value.start ?? dateConditions.value;
// const started = startDate <= monthUtils.addMonths(current_month, 1);
if (num_months >= 0) {
if (num_months < 0) {
//non-repeating schedules could be negative
errors.push(`Schedule ${template[ll].name} is in the Past.`);
} else {
t.push({
target,
next_date_string,
Expand Down Expand Up @@ -111,8 +113,6 @@ async function createScheduleList(template, current_month) {
`Schedule ${t[ll].name} is not active during the month in question.`,
);
}
} else {
errors.push(`Schedule ${template[ll].name} is in the Past.`);
}
}
return { t: t.filter(c => c.completed === 0), errors };
Expand Down

0 comments on commit 2b1d2ae

Please sign in to comment.