Skip to content
Snippets Groups Projects
Unverified Commit df74e6dd authored by shall0pass's avatar shall0pass Committed by GitHub
Browse files

Goals: Add recurring schedule support (#1193)

Add recurring schedule support.

To test: use the schedule keyword with a daily or weekly recurring
schedule.
parent 3b3770d6
No related branches found
No related tags found
No related merge requests found
......@@ -533,11 +533,31 @@ async function applyCategoryTemplate(
dateCond,
monthUtils._parse(current_month),
);
let isRepeating =
Object(dateCond.value) === dateCond.value &&
'frequency' in dateCond.value;
let num_months = monthUtils.differenceInCalendarMonths(
next_date_string,
current_month,
);
if (isRepeating) {
let monthlyTarget = 0;
let next_month = monthUtils.addMonths(current_month, num_months + 1);
let next_date = getNextDate(
dateCond,
monthUtils._parse(current_month),
);
while (next_date < next_month) {
monthlyTarget += amountCond.value;
next_date = monthUtils.addDays(next_date, 1);
next_date = getNextDate(dateCond, monthUtils._parse(next_date));
}
amountCond.value = monthlyTarget;
}
if (template.full === true) {
if (num_months === 1) {
to_budget = -getScheduledAmount(amountCond.value);
......
---
category: Enhancements
authors: [shall0pass]
---
Goals: Schedule keyword supports daily or weekly recurring schedules
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment