diff --git a/dashboard/static/index.html b/dashboard/static/index.html
index f1010d7a..f22244cb 100644
--- a/dashboard/static/index.html
+++ b/dashboard/static/index.html
@@ -46,7 +46,7 @@
-
+
{{ duration / 60 | time }} : {{ duration % 60 | time }}
{{ s.params.lead }}
diff --git a/dashboard/static/js/dashboard.js b/dashboard/static/js/dashboard.js
index bce24bcd..7f3dcaf3 100644
--- a/dashboard/static/js/dashboard.js
+++ b/dashboard/static/js/dashboard.js
@@ -118,16 +118,22 @@ angular.module("FICApp")
refreshEvents()
$interval(refreshEvents, 2100);
})
- .controller("CountdownController", function($scope, $interval) {
+ .controller("TimerController", function($scope, $rootScope, $interval) {
$scope.duration = 0;
$scope.init = function(end) {
- $scope.initT(Date.parse(end)/1000);
+ $scope.initT(Date.parse(end));
+ }
+ $scope.initStart = function() {
+ $scope.$watch("settings", function(settings){
+ if (settings)
+ $scope.initT(settings.start);
+ })
}
$scope.initT = function(end) {
var time = angular.fromJson(sessionStorage.userService);
- var srv_cur = (Date.now() + (time.cu * 1000 - time.he)) / 1000;
- $scope.duration += Math.floor(end - srv_cur);
+ var srv_cur = new Date(Date.now() + (time.cu - time.he));
+ $scope.duration = Math.floor((end - srv_cur)/1000);
}
var stop = $interval(function() {