From 69948aa53a9d6cff32fabc41a1520fdaad09411a Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 16 Apr 2013 19:48:43 +0200 Subject: [PATCH] WCF.Date.Time now only supports past dates Every date which is in the future will be displayed as "1 Minute Ago" --- wcfsetup/install/files/js/WCF.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 31ba173c44..313fc67e07 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -2363,14 +2363,9 @@ WCF.Date.Time = Class.extend({ var $time = $element.data('time'); var $offset = $element.data('offset'); - // timestamp is in the future - if ($timestamp > this._timestamp) { - var $string = WCF.Language.get('wcf.date.dateTimeFormat'); - $element.text($string.replace(/\%date\%/, $date).replace(/\%time\%/, $time)); - } // timestamp is less than 60 minutes ago (display 1 hour ago rather than 60 minutes ago) - else if (this._timestamp < ($timestamp + 3540)) { - var $minutes = Math.round((this._timestamp - $timestamp) / 60); + if ($timestamp >= this._timestamp || this._timestamp < ($timestamp + 3540)) { + var $minutes = Math.max(Math.round((this._timestamp - $timestamp) / 60), 1); $element.text(eval(WCF.Language.get('wcf.date.relative.minutes'))); } // timestamp is less than 24 hours ago -- 2.20.1