Fix date notation with slashes in opendata imports

这个提交包含在:
Lucas Verney 2020-01-02 09:58:26 +01:00
父节点 42b5021825
当前提交 434bf56e7b
共有 1 个文件被更改,包括 2 次插入2 次删除

查看文件

@ -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)