From 77de7ca4f75a99c27378c2078624b27d1baf849e Mon Sep 17 00:00:00 2001 From: "Ph. SW" Date: Sat, 9 Dec 2023 19:09:14 +0100 Subject: [PATCH] Change le type de champ pour la date de publication des unes (#6544) Fix #6524 --- zds/featured/forms.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/zds/featured/forms.py b/zds/featured/forms.py index 60ea5ff3cb..49fd981e1e 100644 --- a/zds/featured/forms.py +++ b/zds/featured/forms.py @@ -31,20 +31,8 @@ class Meta: ) pubdate = forms.DateTimeField( - label=_("Date de publication (exemple: 25/12/2015 15:00 ou 2015-12-25T15:00)"), - input_formats=[ - "%d/%m/%Y %H:%M:%S", - "%Y-%m-%d %H:%M:%S", # full format with second - "%Y-%m-%dT%H:%M", # datetime field format - "%Y-%m-%d %H:%M", - "%d/%m/%Y %H:%M", # without second - "%Y-%m-%d", - "%d/%m/%Y", # day only - ], - widget=forms.DateTimeInput( - attrs={"placeholder": _("Exemple : 25/12/2016 10:00"), "type": "text"}, - format="%d/%m/%Y %H:%M", # datetime field format - ), + label=_("Date de publication (exemple: 25/12/2015 15:00)"), + widget=forms.DateTimeInput(attrs={"type": "datetime-local"}), ) request = forms.IntegerField(widget=forms.HiddenInput(), required=False)