Skip to content
Snippets Groups Projects
Commit 06f084ff authored by Hugo's avatar Hugo
Browse files

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

parent 88c3b97c
No related branches found
No related tags found
1 merge request!7load: value.ValeurIndex - data[index - 1].ValeurIndex,
{
"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')),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment