diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-30 12:23:34 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-30 12:23:34 +0200 |
commit | abd5ef4c4c6ad3cf8e879f6c4b9181b077165952 (patch) | |
tree | 11052b0a6c61569b5041ca0237053b870905ba46 /js/controller/ContentController.js | |
parent | 4c728e789f50510f07822e61633a8b3c383daf12 (diff) |
finish content controller
Diffstat (limited to 'js/controller/ContentController.js')
-rw-r--r-- | js/controller/ContentController.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/js/controller/ContentController.js b/js/controller/ContentController.js index 5a75f68ab..1af22ea5c 100644 --- a/js/controller/ContentController.js +++ b/js/controller/ContentController.js @@ -12,13 +12,15 @@ function (Publisher, FeedResource, ItemResource, SettingsResource, data, $route, $routeParams) { 'use strict'; - this.isAutoPagingEnabled = true; - + // dont cache items across multiple route changes ItemResource.clear(); // distribute data to models based on key Publisher.publishAll(data); + + this.isAutoPagingEnabled = true; + this.getItems = () => { return ItemResource.getAll(); }; @@ -101,9 +103,13 @@ function (Publisher, FeedResource, ItemResource, SettingsResource, data, }); }; - // TBD this.getRelativeDate = (timestamp) => { - console.log(timestamp); + if (timestamp !== undefined && timestamp !== '') { + let languageCode = SettingsResource.get('language'); + return moment.unix(timestamp).lang(languageCode).fromNow(); + } else { + return ''; + } }; });
\ No newline at end of file |