Fixe GMT bug in graph

This commit is contained in:
Chteufleur 2015-09-28 22:20:13 +02:00
parent 62c2f4dc35
commit 049734f8a3
2 changed files with 7 additions and 3 deletions

View File

@ -8,6 +8,11 @@ import (
"html/template"
"strconv"
"time"
)
var (
_, timezoneOffset = time.Now().Zone()
)
type ViewTempController struct {
@ -49,7 +54,7 @@ func formatDataSensor(sensorName string, values []temperature.TempTable) string
if i > 0 {
ret += ","
}
horodate := strconv.FormatInt(values[i].HorodateGMT.Unix() * 1000, 10)
horodate := strconv.FormatInt((values[i].HorodateGMT.Unix()+int64(timezoneOffset)) * 1000, 10)
value := strconv.FormatInt(values[i].Value, 10)
ret += "["+horodate+","+value+"]"
}

View File

@ -58,8 +58,7 @@
});
Highcharts.setOptions({
global: {
useUTC: true,
timezoneOffset: -4 * 60
useUTC: false
}
});
</script>