revert weather 'age' back to the short datetime reported with the message. we can revisite using 'age' once we have a valid system time for the raspberry pi to compute against

pull/101/head
bradanlane 2015-11-06 10:53:53 -05:00
rodzic 98795f3da1
commit d6da11c29c
1 zmienionych plików z 8 dodań i 4 usunięć

Wyświetl plik

@ -124,10 +124,14 @@ function WeatherCtrl($rootScope, $scope, $state, $http, $interval) {
data_item.flight_condition = parseFlightCondition(obj.Type, obj.Data);
data_item.location = obj.Location;
var dThen = parseShortDatetime(obj.Time);
var dNow = new Date(obj.LocaltimeReceived);
data_item.age = dThen.getTime();
data_item.time = utcTimeString(Math.abs(dNow - dThen)) + " old";
s = obj.Time;
data_item.time = s.substring(0, 2) + '-' + s.substring(2, 4) + ':' + s.substring(4, 6) + 'Z';
// we can not accurately determime the current time on the Stratux
// calculating age of a weather report is indeterminate
// var dThen = parseShortDatetime(obj.Time);
// var dNow = new Date(obj.LocaltimeReceived);
// data_item.age = dThen.getTime();
// data_item.time = utcTimeString(Math.abs(dNow - dThen)) + " old";
data_item.received = utcTimeString(obj.LocaltimeReceived);
data_item.data = obj.Data;
}