Commit 06f084ff authored by Hugo's avatar Hugo
Browse files

load: value.ValeurIndex - data[index - 1].ValeurIndex,

parent 88c3b97c
{
"version": "0.2.2",
"version": "1.0.0",
"name": "EGL",
"type": "konnector",
"language": "node",
......
{
"name": "egl",
"version": "0.2.2",
"version": "1.0.0",
"description": "",
"repository": {
"type": "git",
......
......@@ -239,9 +239,9 @@ function format(response) {
log('info', 'filtered size is : ' + dataLen)
const mapData = data.map((value, index) => {
const time = moment(value.DateReleve, moment.ISO_8601)
if (index + 1 < dataLen) {
if (index !== 0 && index < dataLen) {
return {
load: data[index + 1].ValeurIndex - value.ValeurIndex,
load: value.ValeurIndex - data[index - 1].ValeurIndex,
year: parseInt(time.format('YYYY')),
month: parseInt(time.format('M')),
day: parseInt(time.format('D')),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment