From 5207447c6831e07eec9047a68ab72dc9330a6472 Mon Sep 17 00:00:00 2001 From: Mael Date: Wed, 25 Jul 2018 10:01:02 +0000 Subject: [PATCH] Correction du script de compression des taux de versemenent transport --- source/règles/transform-taux-versement-transport.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/règles/transform-taux-versement-transport.js b/source/règles/transform-taux-versement-transport.js index 115ac8496..c6477b8b0 100644 --- a/source/règles/transform-taux-versement-transport.js +++ b/source/règles/transform-taux-versement-transport.js @@ -7,6 +7,7 @@ let taux = require('./taux-versement-transport-bruts.json') let { sort, + filter, head, pipe, map, @@ -65,6 +66,11 @@ let additionnalResults = villesAvecArrondissements.map( let extractLastTaux = pipe( toPairs, sort(([date1], [date2]) => (date1 > date2 ? -1 : 1)), + filter( + ([date]) => + console.log(date, new Date(date) <= Date.now()) || + new Date(date) <= Date.now() + ), head, ([, rate]) => rate )