Skip to content

Commit 2d294cc

Browse files
committed
fix time
1 parent 384848c commit 2d294cc

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

js/tracker.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3593,6 +3593,7 @@ function refreshNewReceivers(initial, serial) {
35933593
data_str = "duration=1m";
35943594
}
35953595

3596+
35963597
$.ajax({
35973598
type: "GET",
35983599
url: receivers_url,
@@ -3816,7 +3817,9 @@ function updateChase(r) {
38163817
dataTempEntry.gps_alt = last.uploader_position[2];
38173818
dataTempEntry.gps_lat = last.uploader_position[0];
38183819
dataTempEntry.gps_lon = last.uploader_position[1];
3819-
var time = new Date(last.ts).toISOString();
3820+
var date = new Date(last.ts)
3821+
var userTimezoneOffset = date.getTimezoneOffset() * 60000;
3822+
var time = new Date(date.getTime() - userTimezoneOffset).toISOString();
38203823
dataTempEntry.gps_time = time;
38213824
dataTempEntry.server_time = time;
38223825
dataTempEntry.vehicle = last.uploader_callsign + "_chase";
@@ -4113,13 +4116,11 @@ function updateLeaderboardPane(r){
41134116
function updateLaunchPredictions(r) {
41144117
for (serial in r) {
41154118
prediction = r[serial];
4116-
if(prediction.hasOwnProperty("launch_site")) {
4117-
if(vehicles.hasOwnProperty(serial)) {
4118-
vehicle = vehicles[serial];
4119-
if (vehicle.prediction_launch == null) {
4120-
vehicle.prediction_launch = prediction;
4121-
drawLaunchPrediction(serial);
4122-
}
4119+
if(vehicles.hasOwnProperty(serial)) {
4120+
vehicle = vehicles[serial];
4121+
if (vehicle.prediction_launch == null) {
4122+
vehicle.prediction_launch = prediction;
4123+
drawLaunchPrediction(serial);
41234124
}
41244125
}
41254126
}

0 commit comments

Comments
 (0)