Use local timezone for pumping graph data (#478)

This commit is contained in:
appletalk 2022-06-10 22:00:40 -07:00 committed by GitHub
parent c1ee2a940b
commit b2c228fac9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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