diff options
Diffstat (limited to 'js-old/filter/UnreadCountFormatter.js')
-rw-r--r-- | js-old/filter/UnreadCountFormatter.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js-old/filter/UnreadCountFormatter.js b/js-old/filter/UnreadCountFormatter.js new file mode 100644 index 000000000..51e275006 --- /dev/null +++ b/js-old/filter/UnreadCountFormatter.js @@ -0,0 +1,19 @@ +/** + * Nextcloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Bernhard Posselt <dev@bernhard-posselt.com> + * @copyright Bernhard Posselt 2014 + */ +app.filter('unreadCountFormatter', function () { + 'use strict'; + + return function (unreadCount) { + if (unreadCount > 999) { + return '999+'; + } + return unreadCount; + }; +});
\ No newline at end of file |