Fix timedelta 1 roku

This commit is contained in:
Pavel "LEdoian" Turinsky 2020-12-02 18:06:12 +01:00
parent 8e17ad9f46
commit 7b4366fdaf

View file

@ -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")