Use live timestamps in the versions tab of the sidebar

This commit is contained in:
Joas Schilling 2016-08-31 17:44:28 +02:00
parent ee838a224e
commit 0c73797131
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 2 additions and 1 deletions

View File

@ -15,7 +15,7 @@
'<li data-revision="{{timestamp}}">' +
'<img class="preview" src="{{previewUrl}}"/>' +
'<a href="{{downloadUrl}}" class="downloadVersion"><img src="{{downloadIconUrl}}" />' +
'<span class="versiondate has-tooltip" title="{{formattedTimestamp}}">{{relativeTimestamp}}</span>' +
'<span class="versiondate has-tooltip live-relative-timestamp" data-timestamp="{{millisecondsTimestamp}}" title="{{formattedTimestamp}}">{{relativeTimestamp}}</span>' +
'</a>' +
'{{#canRevert}}' +
'<a href="#" class="revertVersion" title="{{revertLabel}}"><img src="{{revertIconUrl}}" /></a>' +
@ -183,6 +183,7 @@
_formatItem: function(version) {
var timestamp = version.get('timestamp') * 1000;
return _.extend({
millisecondsTimestamp: timestamp,
formattedTimestamp: OC.Util.formatDate(timestamp),
relativeTimestamp: OC.Util.relativeModifiedDate(timestamp),
downloadUrl: version.getDownloadUrl(),