From 89d1ae0c3579112bd5ea1a868a1d95c7a75314c7 Mon Sep 17 00:00:00 2001 From: Bobby Date: Sun, 11 Feb 2024 21:49:51 -0500 Subject: Optimized image serving + bug fixes --- dev_status/utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dev_status/utils.py') diff --git a/dev_status/utils.py b/dev_status/utils.py index f271e91b..02876dc5 100644 --- a/dev_status/utils.py +++ b/dev_status/utils.py @@ -8,17 +8,17 @@ def relative_date(entry): now = datetime.now() diff = now - committedDate if diff.days > 365: - entry["commit"]["committedDate"] = str(diff.days // 365) + " years ago" + entry["commit"]["committedDate"] = str(diff.days // 365) + " year" + ("s" if diff.days // 365 > 1 else "") + " ago" elif diff.days > 30: - entry["commit"]["committedDate"] = str(diff.days // 30) + " months ago" + entry["commit"]["committedDate"] = str(diff.days // 30) + " month" + ("s" if diff.days // 30 > 1 else "") + " ago" elif diff.days > 7: - entry["commit"]["committedDate"] = str(diff.days // 7) + " weeks ago" + entry["commit"]["committedDate"] = str(diff.days // 7) + " week" + ("s" if diff.days // 7 > 1 else "") + " ago" elif diff.days > 0: - entry["commit"]["committedDate"] = str(diff.days) + " days ago" + entry["commit"]["committedDate"] = str(diff.days) + " day" + ("s" if diff.days > 1 else "") + " ago" elif diff.seconds > 3600: - entry["commit"]["committedDate"] = str(diff.seconds // 3600) + " hours ago" + entry["commit"]["committedDate"] = str(diff.seconds // 3600) + " hour" + ("s" if diff.seconds // 3600 > 1 else "") + " ago" elif diff.seconds > 60: - entry["commit"]["committedDate"] = str(diff.seconds // 60) + " minutes ago" + entry["commit"]["committedDate"] = str(diff.seconds // 60) + " minute" + ("s" if diff.seconds // 60 > 1 else "") + " ago" else: entry["commit"]["committedDate"] = "just now" -- cgit v1.2.3