Commit 01eadfce authored by Kristian Tan's avatar Kristian Tan

Displaying daily total on html

parent ec3dd2ed
...@@ -82,7 +82,7 @@ def toggle_pin(change_pin): ...@@ -82,7 +82,7 @@ def toggle_pin(change_pin):
if pins[change_pin]['on_time'] is not None: if pins[change_pin]['on_time'] is not None:
latest_entry = db.session.query(DailyUsage).order_by(DailyUsage.id.desc()).first() latest_entry = db.session.query(DailyUsage).order_by(DailyUsage.id.desc()).first()
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)
print(latest_entry) print(latest_entry_date)
start_time = pins[change_pin]['on_time'] start_time = pins[change_pin]['on_time']
# Get the elapsed time and strip away milliseconds # Get the elapsed time and strip away milliseconds
elapsed = int((datetime.now() - start_time).total_seconds()) elapsed = int((datetime.now() - start_time).total_seconds())
......
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