diff options
Diffstat (limited to 'ebus/webapp/static/src')
-rw-r--r-- | ebus/webapp/static/src/ebus.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ebus/webapp/static/src/ebus.js b/ebus/webapp/static/src/ebus.js index ba14f51..46a9ed8 100644 --- a/ebus/webapp/static/src/ebus.js +++ b/ebus/webapp/static/src/ebus.js @@ -66,10 +66,15 @@ $(document).ready(function(){ unplotSensorDetail(sensorname); unplotSensorOverview(sensorname); }; + var tzFix = function(d) { + return d - new Date().getTimezoneOffset() * 60 * 1000; + } + var plotSensorDetail = function(sensorConfig) { $.getJSON("sensor/"+escape(sensorConfig.sensorname)+"/"+from+"/"+to, function(response) { if (response['data']) { + response.data = response.data.map(function(d) { return [ tzFix(d[0]), d[1] ]; }); datasetDetail.push({'data':response['data'], 'label':sensorConfig.sensorname, 'color':sensorConfig.color}); @@ -94,6 +99,7 @@ $(document).ready(function(){ $.getJSON("sensor_cached/"+escape(sensorConfig.sensorname)+"/"+fromOverview, //+"/"+to, function(response) { if (response['data']) { + response.data = response.data.map(function(d) { return [ tzFix(d[0]), d[1] ]; }); datasetOverview.push({'data':response['data'], 'label':sensorConfig.sensorname, 'color':sensorConfig.color}); |