From 434bf56e7b122a8d29b1038f2e869d6553dda0db Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Thu, 2 Jan 2020 09:58:26 +0100 Subject: [PATCH] Fix date notation with slashes in opendata imports --- scripts/opendata/works.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/opendata/works.py b/scripts/opendata/works.py index 4b67ac7..6a04ca0 100755 --- a/scripts/opendata/works.py +++ b/scripts/opendata/works.py @@ -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)