From 013cf68a5891ddc0e4b94ee51c4917085b3138bc Mon Sep 17 00:00:00 2001 From: "ext.sopra.yvallet@grandlyon.com" <ext.sopra.yvallet@grandlyon.com> Date: Thu, 18 Feb 2021 17:30:41 +0100 Subject: [PATCH] publish: l2log generated from commit 7351b5ce08d80bb4e01acf072f0032ac77b25e42 --- index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index e0ca059..d9b5c6f 100644 --- a/index.js +++ b/index.js @@ -138,7 +138,8 @@ moment.tz.setDefault('Europe/Paris') // set the timezone const startDate = moment() .startOf('year') - .subtract(3, 'year') + // .subtract(3, 'year') TODO PUT TERNARY EXPRESSION FOR MANUAL LAUNCH + .subtract(1, 'year') .subtract(1, 'day') .format('MM/DD/YYYY') const endDate = moment().format('MM/DD/YYYY') @@ -274,6 +275,7 @@ async function getData(response, baseUrl, apiAuthKey) { function format(response) { const data = response.resultatRetour.slice(1).map((value, index) => { const time = moment(value.DateReleve, moment.ISO_8601) + log('info', 'SUBSTRACTING : ' + value.ValeurIndex + ' - ' + response.resultatRetour[index].ValeurIndex + '\n') return { // Add if/else to not substract null value (typeagregat T) load: value.TypeAgregat === 'T' ? null : value.ValeurIndex - response.resultatRetour[index].ValeurIndex, @@ -285,7 +287,10 @@ function format(response) { type: value.TypeAgregat } }) - log('info', 'Dataload is : ' + data) + log('info', 'DATALOAD LIST\n') + data.map((value) => { + log('info', value.month + '-' + value.day + '-' + value.year + ' : ' + value.load + '\n') + }) return data } -- GitLab