From 4b3a5a257f0861db23b8d97836afdf398b3fef9a Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 2 Oct 2015 10:16:21 +0200 Subject: Fix moment.js "a few seconds ago" with "seconds ago" * fixes #18627 --- core/js/js.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/js/js.js') diff --git a/core/js/js.js b/core/js/js.js index e40141ac617..36fa90e78a3 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1533,6 +1533,10 @@ OC.Util = { * @returns {string} human readable difference from now */ relativeModifiedDate: function (timestamp) { + var diff = moment().diff(moment(timestamp)); + if (diff >= 0 && diff < 45000 ) { + return t('core', 'seconds ago'); + } return moment(timestamp).fromNow(); }, /** -- cgit v1.2.3