Get only the ten first characters for the date

This commit is contained in:
Yohann D'ANELLO 2020-10-02 17:42:56 +02:00
parent 8c8692b8d2
commit 9c53d89ad3
1 changed files with 1 additions and 1 deletions

View File

@ -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']: