From abef169382e113c1e070eca74373f2118042a0a0 Mon Sep 17 00:00:00 2001 From: Leigh Morresi <275001+dgtlmoon@users.noreply.github.com> Date: Fri, 29 Jan 2021 14:45:12 +0100 Subject: [PATCH] Tidy up 'last_checked' date handling --- backend/backend.py | 2 +- backend/templates/watch-overview.html | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/backend.py b/backend/backend.py index c9c2ed3f..fbd04f1a 100644 --- a/backend/backend.py +++ b/backend/backend.py @@ -57,7 +57,7 @@ def _jinja2_filter_datetime(watch_obj, format="%Y-%m-%d %H:%M:%S"): if watch_obj['last_checked'] == 0: return 'Not yet' - return datetime.datetime.utcfromtimestamp(int(watch_obj['last_checked'])).strftime(format) + return timeago.format(int(watch_obj['last_checked']), time.time()) # @app.context_processor diff --git a/backend/templates/watch-overview.html b/backend/templates/watch-overview.html index 12d3d048..80f57f8d 100644 --- a/backend/templates/watch-overview.html +++ b/backend/templates/watch-overview.html @@ -8,14 +8,13 @@ Add new change detection watch - + - - Note: Times are in UTC for now - todo - JS front end format
+