Skip to content

Commit

Permalink
added simple variable for S for plural/singular units
Browse files Browse the repository at this point in the history
  • Loading branch information
itslenny committed Mar 18, 2014
1 parent a4fbd4d commit 438b38f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/js/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,13 @@ angular.module('timer', [])

function calculateTimeUnits() {
$scope.seconds = Math.floor(($scope.millis / 1000) % 60);
$scope.secondsS = $scope.seconds==1 ? '' : 's';
$scope.minutes = Math.floor((($scope.millis / (60000)) % 60));
$scope.minutesS = $scope.minutesS==1 ? '' : 's';
$scope.hours = Math.floor((($scope.millis / (3600000)) % 24));
$scope.hoursS = $scope.hoursS==1 ? '' : 's';
$scope.days = Math.floor((($scope.millis / (3600000)) / 24));
$scope.daysS = $scope.daysS==1 ? '' : 's';
}

//determine initial values of time units and add AddSeconds functionality
Expand Down

0 comments on commit 438b38f

Please sign in to comment.