summaryrefslogtreecommitdiffstats
path: root/dash/pages/satellites.py
diff options
context:
space:
mode:
authorLukas Metzger2020-07-02 12:30:15 +0200
committerLukas Metzger2020-07-02 12:30:15 +0200
commitdef8d90e3b7ca51e2a14f0f631b84e4842f04c49 (patch)
treeb8ddc32c784d729a7bf6ec9597cc50a3d8bccad6 /dash/pages/satellites.py
parentRemove unneccessary debug output (diff)
downloadbwlp-statistics-def8d90e3b7ca51e2a14f0f631b84e4842f04c49.tar.gz
bwlp-statistics-def8d90e3b7ca51e2a14f0f631b84e4842f04c49.tar.xz
bwlp-statistics-def8d90e3b7ca51e2a14f0f631b84e4842f04c49.zip
Added prettytime function and use it
Diffstat (limited to 'dash/pages/satellites.py')
-rw-r--r--dash/pages/satellites.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/dash/pages/satellites.py b/dash/pages/satellites.py
index ba607ba..37a1f61 100644
--- a/dash/pages/satellites.py
+++ b/dash/pages/satellites.py
@@ -6,8 +6,8 @@ import dash_table as dtbl
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output
-import humanize
import datetime as dt
+from prettytime import prettytime
import db
from app import app
@@ -78,8 +78,8 @@ def load_table(sort):
data = cursor.fetchall()
for record in data:
- record['uptime'] = humanize.naturaldelta(dt.timedelta(seconds=record['uptime']))
- record['date'] = humanize.naturaldelta(dt.date.today() - record['date'])
+ record['uptime'] = prettytime(record['uptime'])
+ record['date'] = prettytime((dt.date.today() - record['date']).total_seconds())
db.closeConnection(dbcon)
return data