Skip to content

Commit

Permalink
Fix recurring transaction edit not taking account of start_date
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Ferreira committed Oct 3, 2017
1 parent fe9e2a8 commit d43306d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,12 @@ def generate_recurring(account_id, label, amount, start_date, end_date, recurrin
rule_string = "RRULE:FREQ={};BYMONTHDAY={};INTERVAL=1".format(frequency, recurrence_day)
elif frequency == 'YEARLY':
rule_string = "RRULE:FREQ={};BYMONTH={};BYMONTHDAY={}".format(frequency, recurrence_month, recurrence_day)
if future_only:
start_date = datetime.today() + timedelta(days=1)
if (isinstance(start_date, str)):
start_date = parse(start_date)
if (isinstance(end_date, str)):
end_date = parse(end_date)
if future_only and start_date < datetime.now().date():
start_date = datetime.today() + timedelta(days=1)
rule = rrulestr(rule_string, dtstart=datetime.combine(start_date, time()))
times = rule.between(
after=datetime.combine(start_date, time()),
Expand Down

0 comments on commit d43306d

Please sign in to comment.