From 7b4366fdafec51135e12881800acf3338319139c Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Wed, 2 Dec 2020 18:06:12 +0100 Subject: [PATCH] Fix timedelta 1 roku --- seminar/templatetags/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seminar/templatetags/utils.py b/seminar/templatetags/utils.py index 4d5de06d..1cb92d6a 100644 --- a/seminar/templatetags/utils.py +++ b/seminar/templatetags/utils.py @@ -21,7 +21,7 @@ def kratke_datum(dt): delta = now - dt if delta <= timedelta(days=1): return dt.strftime("%k:%M") - if delta <= timedelta(years=1): + if delta <= timedelta(days=365): # Timedelta neumí vyjádřit 1 rok return dt.strftime("%d. %m.") return dt.strftime("%d. %m. %Y")