diff options
| author | Chris Smith <toonarmy@phpbb.com> | 2010-07-07 22:52:04 +0100 |
|---|---|---|
| committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-03-14 22:57:30 -0400 |
| commit | e9fe9ea5185679e9950e330c949cc2577bfea21d (patch) | |
| tree | 968b4328329171da1317933f0e60c6e3dd3e8c55 /phpBB | |
| parent | 5dd7916c496b76ab2e1e28b804069dde63f7dbf0 (diff) | |
| download | forums-e9fe9ea5185679e9950e330c949cc2577bfea21d.tar forums-e9fe9ea5185679e9950e330c949cc2577bfea21d.tar.gz forums-e9fe9ea5185679e9950e330c949cc2577bfea21d.tar.bz2 forums-e9fe9ea5185679e9950e330c949cc2577bfea21d.tar.xz forums-e9fe9ea5185679e9950e330c949cc2577bfea21d.zip | |
[feature/new-tz-handling] Fix bug from 3.0 formatting future dates.
Future dates can get formatted as 'less than a minute ago' if they
occur in the future on the same minute as the current minute.
PHPBB3-9558 PHPBB3-9712
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/includes/datetime.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/phpBB/includes/datetime.php b/phpBB/includes/datetime.php index ecb3dfcf17..2276d36413 100644 --- a/phpBB/includes/datetime.php +++ b/phpBB/includes/datetime.php @@ -85,9 +85,10 @@ class phpbb_datetime extends DateTime if ($relative) { // Check the delta is less than or equal to 1 hour + // and the delta not more than a minute in the past // and the delta is either greater than -5 seconds or timestamp and current time are of the same minute (they must be in the same hour already) // finally check that relative dates are supported by the language pack - if ($delta <= 3600 && ($delta >= -5 || (($now_ts / 60) % 60) == (($timestamp / 60) % 60)) && isset($this->_user->lang['datetime']['AGO'])) + if ($delta <= 3600 && $delta > -60 && ($delta >= -5 || (($now_ts / 60) % 60) == (($timestamp / 60) % 60)) && isset($this->_user->lang['datetime']['AGO'])) { return $this->_user->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60))); } |
