From 9c53d89ad352c0f0625fc55ebbe77bbc2a88ce47 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 2 Oct 2020 17:42:56 +0200 Subject: [PATCH] Get only the ten first characters for the date --- media/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/forms.py b/media/forms.py index 40d8efe..e137b1a 100644 --- a/media/forms.py +++ b/media/forms.py @@ -137,7 +137,7 @@ class MediaAdminForm(ModelForm): if 'publishedDate' in info: if "-" not in info["publishedDate"]: info["publishedDate"] += "-01-01" - self.cleaned_data['publish_date'] = info['publishedDate'] + self.cleaned_data['publish_date'] = info['publishedDate'][:10] if 'authors' not in self.cleaned_data \ or not self.cleaned_data['authors']: