Skip to content

Commit

Permalink
Adding packaged files for release to bower
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Conolly committed Oct 27, 2015
1 parent 9b71262 commit eb064f2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions app/package/js/ordinal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* global angular */

angular
.module('ordinal', [])
.factory('ordinalService', function () {
var ordinal = function (input) {
var n = input % 100;
return n === 0 ? 'th' : (n < 11 || n > 13) ?
['st', 'nd', 'rd', 'th'][Math.min((n - 1) % 10, 3)] : 'th';
};
return {
ordinal: ordinal
};
})
.filter('ordinal', ['ordinalService', function (ordinalService) {
return function (input) {
return input + ordinalService.ordinal(input);
};
}])
.filter('ordinalOnly', ['ordinalService', function (ordinalService) {
return function (input) {
return ordinalService.ordinal(input);
};
}]);
1 change: 1 addition & 0 deletions app/package/js/ordinal.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eb064f2

Please sign in to comment.