From f3114f092487bedf4f68d445aa364e90d0ecbd5f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 20 Oct 2012 18:09:43 +0200 Subject: [PATCH] Properly handle dates in the future --- wcfsetup/install/files/js/WCF.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 7f9249beec..8a83076959 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -2077,8 +2077,13 @@ WCF.Date.Time.prototype = { 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) - if (this.timestamp < ($timestamp + 3540)) { + else if (this.timestamp < ($timestamp + 3540)) { var $minutes = Math.round((this.timestamp - $timestamp) / 60); $(element).text(eval(WCF.Language.get('wcf.date.relative.minutes'))); } -- 2.20.1