@@ -168,12 +168,12 @@ var timerModule = angular.module('timer', [])
168
168
$scope . monthsS = ( $scope . months === 1 ) ? '' : 's' ;
169
169
$scope . yearsS = ( $scope . years === 1 ) ? '' : 's' ;
170
170
// new plural-singular unit decision functions (for custom units and multilingual support)
171
- $scope . secondUnit = function ( singleSecond , pluralSecond ) { if ( $scope . seconds === 1 ) { return singleSecond ; } return pluralSecond ; } ;
172
- $scope . minuteUnit = function ( singleMinute , pluralMinute ) { if ( $scope . minutes === 1 ) { return singleMinute ; } return pluralMinute ; } ;
173
- $scope . hourUnit = function ( singleHour , pluralHour ) { if ( $scope . hours === 1 ) { return singleHour ; } return pluralHour ; } ;
174
- $scope . dayUnit = function ( singleDay , pluralDay ) { if ( $scope . days === 1 ) { return singleDay ; } return pluralDay ; } ;
175
- $scope . monthUnit = function ( singleMonth , pluralMonth ) { if ( $scope . months === 1 ) { return singleMonth ; } return pluralMonth ; } ;
176
- $scope . yearUnit = function ( singleYear , pluralYear ) { if ( $scope . years === 1 ) { return singleYear ; } return pluralYear ; } ;
171
+ $scope . secondUnit = function ( singleSecond , pluralSecond ) { if ( $scope . seconds === 1 ) { if ( singleSecond ) { return singleSecond ; } return 'second' ; } if ( pluralSecond ) { return pluralSecond ; } return 'seconds' ; } ;
172
+ $scope . minuteUnit = function ( singleMinute , pluralMinute ) { if ( $scope . minutes === 1 ) { if ( singleMinute ) { return singleMinute ; } return 'minute' ; } if ( pluralMinute ) { return pluralMinute ; } return 'minutes' ; } ;
173
+ $scope . hourUnit = function ( singleHour , pluralHour ) { if ( $scope . hours === 1 ) { if ( singleHour ) { return singleHour ; } return 'hour' ; } if ( pluralHour ) { return pluralHour ; } return 'hours' ; } ;
174
+ $scope . dayUnit = function ( singleDay , pluralDay ) { if ( $scope . days === 1 ) { if ( singleDay ) { return singleDay ; } return 'day' ; } if ( pluralDay ) { return pluralDay ; } return 'days' ; } ;
175
+ $scope . monthUnit = function ( singleMonth , pluralMonth ) { if ( $scope . months === 1 ) { if ( singleMonth ) { return singleMonth ; } return 'month' ; } if ( pluralMonth ) { return pluralMonth ; } return 'months' ; } ;
176
+ $scope . yearUnit = function ( singleYear , pluralYear ) { if ( $scope . years === 1 ) { if ( singleYear ) { return singleYear ; } return 'year' ; } if ( pluralYear ) { return pluralYear ; } return 'years' ; } ;
177
177
//add leading zero if number is smaller than 10
178
178
$scope . sseconds = $scope . seconds < 10 ? '0' + $scope . seconds : $scope . seconds ;
179
179
$scope . mminutes = $scope . minutes < 10 ? '0' + $scope . minutes : $scope . minutes ;
0 commit comments