From b2c228fac9d8a7d3abfaf284b37174594493a185 Mon Sep 17 00:00:00 2001 From: appletalk <4085979+appletalk@users.noreply.github.com> Date: Fri, 10 Jun 2022 22:00:40 -0700 Subject: [PATCH] Use local timezone for pumping graph data (#478) --- reports/graphs/pumping_amounts.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reports/graphs/pumping_amounts.py b/reports/graphs/pumping_amounts.py index ff160ab9..84e153bb 100644 --- a/reports/graphs/pumping_amounts.py +++ b/reports/graphs/pumping_amounts.py @@ -20,7 +20,8 @@ def pumping_amounts(objects): curr_date = "" date_totals = {} for object in objects: - date_s = str(object.time.date()) + date_s = timezone.localtime(object.time) + date_s = str(date_s.date()) if curr_date != date_s: date_totals[date_s] = 0.0 curr_date = date_s @@ -30,7 +31,8 @@ def pumping_amounts(objects): amounts = [] # Array of arrays containing amounts index_x, index_y = 0, -1 for object in objects: - date_s = str(object.time.date()) + date_s = timezone.localtime(object.time) + date_s = str(date_s.date()) if date_s not in dates: dates.append(date_s) index_y += 1