fix: support last day of month

This commit is contained in:
chris 2020-10-31 11:33:31 +01:00
parent 9072c5a477
commit eb005eb5c8

View file

@ -35,10 +35,10 @@ def _get_current_limit(budget_id):
).json() ).json()
budgets.extend(budget_json.get('data')) budgets.extend(budget_json.get('data'))
today = datetime.datetime.today() today = datetime.datetime.combine(datetime.date.today(), datetime.datetime.min.time())
return [ return [
budget for budget in budgets budget for budget in budgets
if today > dateutil.parser.parse(budget.get('attributes').get('start')) and today < dateutil.parser.parse(budget.get('attributes').get('end')) if today > dateutil.parser.parse(budget.get('attributes').get('start')) and today <= dateutil.parser.parse(budget.get('attributes').get('end'))
][0] ][0]