diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-01-28 11:47:23 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-02-02 18:01:15 +0100 |
commit | d1518045ecdf4dd006224256b25b292a92b1202d (patch) | |
tree | 47f809b09127d9afdf96c057d74b04834f31aa9c /apps/comments | |
parent | cca33942aa01542c7b9920c80c66e3becd3a0d9c (diff) | |
download | nextcloud-server-d1518045ecdf4dd006224256b25b292a92b1202d.tar.gz nextcloud-server-d1518045ecdf4dd006224256b25b292a92b1202d.zip |
Improve comment date format
Diffstat (limited to 'apps/comments')
-rw-r--r-- | apps/comments/js/commentstabview.js | 13 |
1 files 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 @@ ' <hr />' + ' <div class="authorRow">' + ' <span class="author"><em>{{actorDisplayName}}</em></span>' + - ' <span class="date">{{creationDateTime}}</span>' + + ' <span class="date has-tooltip" title="{{altDate}}">{{date}}</span>' + ' </div>' + ' <div class="message">{{message}}</div>' + '</li>'; @@ -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? |