1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-12 10:35:20 +02:00

[ticket/10345] Remove '1 hour ago' string which conflicted with plural rules

This message was only viewed for 1 second anyway,
as floor($delta / 60) is only 60 for 3600 to 3660,
but the code was limited to $delta <= 3600

PHPBB3-10345
This commit is contained in:
Joas Schilling 2011-09-13 15:34:40 +02:00 committed by Oleg Pudeyev
parent f16d72fcfb
commit 0734dd3c42
2 changed files with 2 additions and 3 deletions

View File

@ -2278,9 +2278,9 @@ class user extends session
// Zone offset // Zone offset
$zone_offset = $this->timezone + $this->dst; $zone_offset = $this->timezone + $this->dst;
// Show date <= 1 hour ago as 'xx min ago' but not greater than 60 seconds in the future // Show date < 1 hour ago as 'xx min ago' but not greater than 60 seconds in the future
// A small tolerence is given for times in the future but in the same minute are displayed as '< than a minute ago' // A small tolerence is given for times in the future but in the same minute are displayed as '< than a minute ago'
if ($delta <= 3600 && $delta > -60 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO'])) if ($delta < 3600 && $delta > -60 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO']))
{ {
return $this->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60))); return $this->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60)));
} }

View File

@ -746,7 +746,6 @@ $lang = array_merge($lang, array(
0 => 'less than a minute ago', 0 => 'less than a minute ago',
1 => '%d minute ago', 1 => '%d minute ago',
2 => '%d minutes ago', 2 => '%d minutes ago',
60 => '1 hour ago',
), ),
'Sunday' => 'Sunday', 'Sunday' => 'Sunday',