From a8f99cbaeb0c2b0b9c3f8bf9f52e5752de28f348 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Mon, 14 Jan 2019 20:56:13 +0100 Subject: [PATCH] Fix an issue with trimester computation --- 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 012bd17..9ca19af 100755 --- a/scripts/opendata/works.py +++ b/scripts/opendata/works.py @@ -60,14 +60,14 @@ def preprocess_hauts_de_seine(data): new_fields['date_debut'] = arrow.get( datetime.datetime( now.year, - (now.month // 3) * 3, + max(1, min((now.month // 3) * 3, 12)), 1 ) ).isoformat() new_fields['date_fin'] = arrow.get( datetime.datetime( now.year, - (now.month // 3 + 1) * 3, + max(1, min((now.month // 3 + 1) * 3, 12)), 1 ) ).isoformat()