If no day of month, set the first day of the month
This commit is contained in:
parent
665f7a2875
commit
80c520d76c
|
@ -147,6 +147,8 @@ class MediaAdminForm(ModelForm):
|
|||
if 'publishedDate' in info:
|
||||
if "-" not in info["publishedDate"]:
|
||||
info["publishedDate"] += "-01-01"
|
||||
elif len(info["publishedDate"]) == 7:
|
||||
info["publishedDate"] += "-01"
|
||||
self.cleaned_data['publish_date'] = info['publishedDate'][:10]
|
||||
|
||||
if 'authors' not in self.cleaned_data \
|
||||
|
|
Loading…
Reference in New Issue