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
1 changed files with 3 additions and 1 deletions

View File

@ -16,7 +16,9 @@
// Iterate through the data and put it into the arrays.
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);
values.push(data[j][name]);
}