dashboard: use server time to calculate event time
This commit is contained in:
parent
17a9d39556
commit
42a17ab450
|
@ -3,7 +3,11 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
|
|||
$scope.events = [];
|
||||
var refreshEvents = function() {
|
||||
// Update times
|
||||
var now = new Date().getTime();
|
||||
var time = angular.fromJson(sessionStorage.time);
|
||||
var now = Date.now();
|
||||
if (time)
|
||||
now += time.cu - time.he;
|
||||
now = new Date(now);
|
||||
$scope.events.forEach(function(ev) {
|
||||
ev.since = now - ev.time;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue