From d1518045ecdf4dd006224256b25b292a92b1202d Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 28 Jan 2016 11:47:23 +0100 Subject: Improve comment date format --- apps/comments/js/commentstabview.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index cccb400dd68..b1a3f854fe1 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -30,7 +30,7 @@ '
' + '
' + ' {{actorDisplayName}}' + - ' {{creationDateTime}}' + + ' {{date}}' + '
' + '
{{message}}
' + ''; @@ -101,8 +101,13 @@ }, _formatItem: function(commentModel) { + var timestamp = new Date(commentModel.get('creationDateTime')).getTime(); + var data = _.extend({ + date: OC.Util.relativeModifiedDate(timestamp), + altDate: OC.Util.formatDate(timestamp) + }, commentModel.attributes); // TODO: format - return commentModel.attributes; + return data; }, _toggleLoading: function(state) { @@ -128,6 +133,7 @@ } else { this.$container.append($el); } + $el.find('.has-tooltip').tooltip(); }, nextPage: function() { @@ -152,7 +158,8 @@ actorDisplayName: OC.currentUser, actorType: 'users', verb: 'comment', - message: $textArea.val() + message: $textArea.val(), + creationDateTime: (new Date()).getTime() }, {at: 0}); // TODO: spinner/disable field? -- cgit v1.2.3