From: Tim Düsterhus Date: Sat, 20 Oct 2012 16:09:43 +0000 (+0200) Subject: Properly handle dates in the future X-Git-Tag: 2.0.0_Beta_1~836^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f3114f092487bedf4f68d445aa364e90d0ecbd5f;p=GitHub%2FWoltLab%2FWCF.git Properly handle dates in the future --- 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'))); }