mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/9712] Future dates can be formatted as 'less than one minute ago'
PHPBB3-9712
This commit is contained in:
parent
4ac5d5e352
commit
9764a32138
1 changed files with 2 additions and 2 deletions
|
@ -2134,9 +2134,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'
|
// 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 >= -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)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue