Skip to content
Snippets Groups Projects
Commit c70e13b4 authored by Codex's avatar Codex
Browse files

Changing the time format on the persisted Data

parent 6bfc4e05
No related branches found
No related tags found
No related merge requests found
...@@ -108,10 +108,18 @@ async function getData(response, baseUrl, apiAuthKey) { ...@@ -108,10 +108,18 @@ async function getData(response, baseUrl, apiAuthKey) {
function format(response) { function format(response) {
const data = response.resultatRetour.slice(1).map((value, index) => { const data = response.resultatRetour.slice(1).map((value, index) => {
const time = moment(value.DateReleve, moment.ISO_8601).format('YYYY-MM-DD');
return { return {
time: moment(value.DateReleve, moment.ISO_8601).format('YYYY-MM-DD'),
load: value.ValeurIndex - response.resultatRetour[index].ValeurIndex, load: value.ValeurIndex - response.resultatRetour[index].ValeurIndex,
type: value.TypeAgregat year: parseInt(time.format('YYYY')),
month: parseInt(time.format('M')),
day: parseInt(time.format('D')),
hour: 0,
minute: 0
//,type: value.TypeAgregat
} }
}) })
return data return data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment