Fix an issue with trimester computation

This commit is contained in:
Lucas Verney 2019-01-14 20:56:13 +01:00
parent d5b9d9f0fc
commit a8f99cbaeb

View File

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