Commit 0061be9c authored by Kristian Tan's avatar Kristian Tan

Displaying daily total on html

parent 816b3fac
...@@ -41,8 +41,7 @@ latest_entry = db.session.query(DailyUsage).order_by(DailyUsage.id.desc()).first ...@@ -41,8 +41,7 @@ latest_entry = db.session.query(DailyUsage).order_by(DailyUsage.id.desc()).first
if latest_entry: if latest_entry:
latest_entry_date = date(latest_entry.date.year, latest_entry.date.month, latest_entry.date.day) latest_entry_date = date(latest_entry.date.year, latest_entry.date.month, latest_entry.date.day)
if latest_entry_date == datetime.today().date(): if latest_entry_date == datetime.today().date():
daily_total += latest_entry.on_time_seconds daily_total = round(latest_entry.on_time_seconds / 60, 2)
# Create dictionary to store pin info # Create dictionary to store pin info
pins = { pins = {
...@@ -113,7 +112,7 @@ def toggle_pin(change_pin): ...@@ -113,7 +112,7 @@ def toggle_pin(change_pin):
if latest_entry: if latest_entry:
latest_entry_date = date(latest_entry.date.year, latest_entry.date.month, latest_entry.date.day) latest_entry_date = date(latest_entry.date.year, latest_entry.date.month, latest_entry.date.day)
if latest_entry_date == datetime.today().date(): if latest_entry_date == datetime.today().date():
daily_total = latest_entry.on_time_seconds daily_total = round(latest_entry.on_time_seconds / 60, 2)
else: else:
daily_total = 0 daily_total = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment