Skip to content

Commit 771479b

Browse files
author
sanderaido
committed
New plural unit decision functions
Removed zero-unit pluralization and added new unit functions with custom string support. Exaple usage in html: <timer>{{ minutes }} {{ minuteUnit('minute','minutes') }} {{ seconds }} {{ secondUnit('second','seconds') }}
1 parent 7e0dcc7 commit 771479b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dist/angular-timer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ var timerModule = angular.module('timer', [])
160160
$scope.months = Math.floor((($scope.millis / (3600000)) / 24 / 30) % 12);
161161
$scope.years = Math.floor(($scope.millis / (3600000)) / 24 / 365);
162162
}
163-
// plural - singular unit decision (old syntax, for backwards compatibility and English only)
163+
// plural - singular unit decision (old syntax, for backwards compatibility and English only, could be deprecated!)
164164
$scope.secondsS = ($scope.seconds === 1) ? '' : 's';
165165
$scope.minutesS = ($scope.minutes === 1) ? '' : 's';
166166
$scope.hoursS = ($scope.hours === 1) ? '' : 's';

0 commit comments

Comments
 (0)