Fix date notation with slashes in opendata imports

This commit is contained in:
Lucas Verney 2020-01-02 09:58:26 +01:00
parent 42b5021825
commit 434bf56e7b
1 changed files with 2 additions and 2 deletions

View File

@ -623,12 +623,12 @@ def process_opendata(name, data, report_type=REPORT_TYPE):
# Check that the work is currently being done
now = arrow.now('Europe/Paris')
if fields['date_debut']:
start_date = arrow.get(fields['date_debut'])
start_date = arrow.get(fields['date_debut'].replace('/', '-'))
else:
# Defaults to now if start date is unknown
start_date = arrow.get(now)
if fields['date_fin']:
end_date = arrow.get(fields['date_fin'])
end_date = arrow.get(fields['date_fin'].replace('/', '-'))
else:
# Defaults to in a week if start date is unknown
end_date = arrow.get(now).shift(days=+7)