3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00

Apply timezone offset to graphed sensor data.

This commit is contained in:
Michael Stenta 2018-11-10 09:50:02 -05:00
parent 84d31b87b4
commit 174286b876

View file

@ -16,7 +16,9 @@
// Iterate through the data and put it into the arrays. // Iterate through the data and put it into the arrays.
for (var j = 0; j < data.length; j++) { for (var j = 0; j < data.length; j++) {
var date = new Date(data[j].timestamp * 1000).toISOString(); var tzoffset = (new Date()).getTimezoneOffset() * 60000;
console.log(tzoffset);
var date = new Date((data[j].timestamp * 1000) - tzoffset).toISOString();
dates.push(date); dates.push(date);
values.push(data[j][name]); values.push(data[j][name]);
} }