From 4b03a2d23ce085f72ff486a90f1c283324c647a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 24 Oct 2022 16:31:22 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20(tab.=20do=C5=A1.=20=C5=99e=C5=A1en=C3=AD?= =?UTF-8?q?):=20strftime=20nefunguje,=20jak=20jsem=20si=20myslel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- odevzdavatko/forms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/odevzdavatko/forms.py b/odevzdavatko/forms.py index 271c448a..0e3582c4 100644 --- a/odevzdavatko/forms.py +++ b/odevzdavatko/forms.py @@ -155,8 +155,10 @@ class OdevzdavatkoTabulkaFiltrForm(forms.Form): result = [] - result.append(( - strftime(DATE_FORMAT, datetime.date.min.timetuple()), f"Odjakživa")) + date_str = strftime(DATE_FORMAT, datetime.date.min.timetuple()) + if date_str[0] == '1': # Někde očividně vrací strftime rok bez nul. + date_str = "000" + date_str + result.append((date_str, f"Odjakživa")) for deadline in m.Deadline.objects.filter( deadline__lte=timezone.now(),