From c3ba376793d25ed760ba5c5083d7757c3df4f794 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Fri, 29 Dec 2023 09:53:59 +0100 Subject: [PATCH] Fix month offset (missing first month in history) --- nummi/history/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nummi/history/utils.py b/nummi/history/utils.py index 282d354..b15e792 100644 --- a/nummi/history/utils.py +++ b/nummi/history/utils.py @@ -32,7 +32,7 @@ def history(transaction_set): "d": [ _history.filter(month=datetime.date(y, m + 1, 1)).first() for m in range( - _first_month.month if _first_month.year == y else 0, + _first_month.month - 1 if _first_month.year == y else 0, _last_month.month if _last_month.year == y else 12, ) ], @@ -45,7 +45,7 @@ def history(transaction_set): return { "years": _data, - "offset": [range(_first_month.month), range(12 - _last_month.month)], + "offset": [range(_first_month.month - 1), range(12 - _last_month.month)], "max": max( _history.aggregate( max=Max("sum_p", default=0),