Skip to content

Commit c0c58f7

Browse files
fix wrong timezone on telemetry graph
1 parent a9d10b8 commit c0c58f7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cache.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CACHE MANIFEST
2-
# version 140
2+
# version 143
33

44
# gogole maps files
55
http://maps.google.com/maps/api/js?v=3.10&sensor=false&key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg

js/tracker.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,9 @@ function graphAddLastPosition(idx) {
874874
vehicles[idx].graph_data_updated = true;
875875
var data = vehicles[idx].graph_data;
876876
var new_data = vehicles[idx].curr_position;
877-
var ts = (new Date(new_data.gps_time)).getTime(); // flot needs miliseconds for time
877+
var date = new Date(new_data.gps_time);
878+
var tz_offset_milis = date.getTimezoneOffset() * 60000;
879+
var ts = date.getTime() - tz_offset_milis;
878880

879881
if(vehicles[idx].graph_data.length) {
880882
var ts_last_idx = data[0].data.length - 1;

0 commit comments

Comments
 (0)