Skip to content

Commit 679aea4

Browse files
committed
Merge pull request siddii#4 from Charuru/master
countdown mins hours seconds
2 parents e55d93c + c76d890 commit 679aea4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎app/js/timer.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ angular.module('timer', [])
6666
}
6767

6868
$scope.millis = new Date() - $scope.startTime;
69+
70+
if ($scope.countdown > 0) {
71+
$scope.millis = $scope.countdown * 1000
72+
}
73+
6974
$scope.seconds = Math.floor(($scope.millis / 1000) % 60);
7075
$scope.minutes = Math.floor((($scope.millis / (1000 * 60)) % 60));
7176
$scope.hours = Math.floor((($scope.millis / (1000 * 60 * 60)) % 24));
@@ -79,4 +84,4 @@ angular.module('timer', [])
7984
$scope.start();
8085
}
8186
};
82-
});
87+
});

0 commit comments

Comments
 (0)