diff options
author | Lukas Metzger | 2020-07-02 12:30:15 +0200 |
---|---|---|
committer | Lukas Metzger | 2020-07-02 12:30:15 +0200 |
commit | def8d90e3b7ca51e2a14f0f631b84e4842f04c49 (patch) | |
tree | b8ddc32c784d729a7bf6ec9597cc50a3d8bccad6 /dash/pages/total.py | |
parent | Remove unneccessary debug output (diff) | |
download | bwlp-statistics-def8d90e3b7ca51e2a14f0f631b84e4842f04c49.tar.gz bwlp-statistics-def8d90e3b7ca51e2a14f0f631b84e4842f04c49.tar.xz bwlp-statistics-def8d90e3b7ca51e2a14f0f631b84e4842f04c49.zip |
Added prettytime function and use it
Diffstat (limited to 'dash/pages/total.py')
-rw-r--r-- | dash/pages/total.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/dash/pages/total.py b/dash/pages/total.py index 9655c51..e21c4b7 100644 --- a/dash/pages/total.py +++ b/dash/pages/total.py @@ -8,6 +8,7 @@ from dash.dependencies import Input, Output import plotly.graph_objects as go import datetime as dt +from prettytime import prettytime import db from app import app @@ -280,10 +281,10 @@ def make_sums(rangeStart, rangeEnd, satellites): db.closeConnection(dbcon) try: - strTimes = 'Total Time: {}h Total Session Time: {}h Total Off Time: {}h'.format( - int(data['totalTime'] / 3600), - int(data['totalSessionTime'] / 3600), - int(data['totalOffTime'] / 3600) + strTimes = 'Total Time: {} Total Session Time: {} Total Off Time: {}'.format( + prettytime(data['totalTime']), + prettytime(data['totalSessionTime']), + prettytime(data['totalOffTime']) ) except: strTimes = "No Data available!" |