Skip to content

Commit 23b7342

Browse files
author
Alexandros Marinos
committed
Merge pull request alexandrosm#1 from kersten/patch-1
Added possibility to show full seconds / minutes / hours
2 parents 783e322 + 71fef68 commit 23b7342

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

app/js/timer.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ angular.module('timer', [])
6969
$scope.$emit('timer-stopped', {millis: $scope.millis, seconds: $scope.seconds, minutes: $scope.minutes, hours: $scope.hours, days: $scope.days});
7070
$scope.timeoutId = null;
7171
};
72-
72+
7373
$scope.end = $element[0].end = function () {
7474
resetTimeout();
7575
$scope.startTime = null;
@@ -90,9 +90,14 @@ angular.module('timer', [])
9090

9191
function calculateTimeUnits() {
9292
$scope.seconds = Math.floor(($scope.millis / 1000) % 60);
93-
$scope.minutes = Math.floor((($scope.millis / (60000)) % 60));
94-
$scope.hours = Math.floor((($scope.millis / (3600000)) % 24));
95-
$scope.days = Math.floor((($scope.millis / (3600000)) / 24));
93+
$scope.minutes = Math.floor(($scope.millis / 60000) % 60);
94+
$scope.hours = Math.floor(($scope.millis / 3600000) % 24);
95+
96+
$scope.fullSeconds = Math.floor($scope.millis / 1000);
97+
$scope.fullMinutes = Math.floor($scope.millis / 60000);
98+
$scope.fullHours = Math.floor($scope.millis / 3600000);
99+
100+
$scope.days = Math.floor(($scope.millis / 3600000) / 24);
96101
}
97102

98103
//determine initial values of time units

0 commit comments

Comments
 (0)