Fixe GMT bug in graph
This commit is contained in:
parent
62c2f4dc35
commit
049734f8a3
|
|
@ -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+"]"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,8 +58,7 @@
|
|||
});
|
||||
Highcharts.setOptions({
|
||||
global: {
|
||||
useUTC: true,
|
||||
timezoneOffset: -4 * 60
|
||||
useUTC: false
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue