summaryrefslogtreecommitdiffstats
path: root/js/controller/ContentController.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/controller/ContentController.js')
-rw-r--r--js/controller/ContentController.js14
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