mirror of https://github.com/snachodog/mybuddy.git
Use local timezone for pumping graph data (#478)
This commit is contained in:
parent
c1ee2a940b
commit
b2c228fac9
|
@ -20,7 +20,8 @@ def pumping_amounts(objects):
|
||||||
curr_date = ""
|
curr_date = ""
|
||||||
date_totals = {}
|
date_totals = {}
|
||||||
for object in objects:
|
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:
|
if curr_date != date_s:
|
||||||
date_totals[date_s] = 0.0
|
date_totals[date_s] = 0.0
|
||||||
curr_date = date_s
|
curr_date = date_s
|
||||||
|
@ -30,7 +31,8 @@ def pumping_amounts(objects):
|
||||||
amounts = [] # Array of arrays containing amounts
|
amounts = [] # Array of arrays containing amounts
|
||||||
index_x, index_y = 0, -1
|
index_x, index_y = 0, -1
|
||||||
for object in objects:
|
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:
|
if date_s not in dates:
|
||||||
dates.append(date_s)
|
dates.append(date_s)
|
||||||
index_y += 1
|
index_y += 1
|
||||||
|
|
Loading…
Reference in New Issue