Commit 80c520d7 authored by ynerant's avatar ynerant

If no day of month, set the first day of the month

parent 665f7a28
Pipeline #4237 passed with stages
in 5 minutes and 33 seconds
......@@ -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 \
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment