File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -154,12 +154,12 @@ var timerModule = angular.module('timer', [])
154
154
$scope . years = Math . floor ( ( $scope . millis / ( 3600000 ) ) / 24 / 365 ) ;
155
155
}
156
156
// plural - singular unit decision
157
- $scope . secondsS = $scope . seconds == 1 ? '' : 's' ;
158
- $scope . minutesS = $scope . minutes == 1 ? '' : 's' ;
159
- $scope . hoursS = $scope . hours == 1 ? '' : 's' ;
160
- $scope . daysS = $scope . days == 1 ? '' : 's' ;
161
- $scope . monthsS = $scope . months == 1 ? '' : 's' ;
162
- $scope . yearsS = $scope . years == 1 ? '' : 's' ;
157
+ $scope . secondsS = ( $scope . seconds == 1 || $scope . seconds == 0 ) ? '' : 's' ;
158
+ $scope . minutesS = ( $scope . minutes == 1 || $scope . minutes == 0 ) ? '' : 's' ;
159
+ $scope . hoursS = ( $scope . hours == 1 || $scope . hours == 0 ) ? '' : 's' ;
160
+ $scope . daysS = ( $scope . days == 1 || $scope . days == 0 ) ? '' : 's' ;
161
+ $scope . monthsS = ( $scope . months == 1 || $scope . months == 0 ) ? '' : 's' ;
162
+ $scope . yearsS = ( $scope . years == 1 || $scope . years == 0 ) ? '' : 's' ;
163
163
//add leading zero if number is smaller than 10
164
164
$scope . sseconds = $scope . seconds < 10 ? '0' + $scope . seconds : $scope . seconds ;
165
165
$scope . mminutes = $scope . minutes < 10 ? '0' + $scope . minutes : $scope . minutes ;
You can’t perform that action at this time.
0 commit comments