mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/new-tz-handling] Fix code and doc layout
PHPBB3-9558
This commit is contained in:
parent
902a79bfda
commit
82e195ac68
2 changed files with 8 additions and 4 deletions
|
@ -65,14 +65,16 @@ class phpbb_datetime extends DateTime
|
||||||
|
|
||||||
if ($relative)
|
if ($relative)
|
||||||
{
|
{
|
||||||
/**
|
/*
|
||||||
* Check the delta is less than or equal to 1 hour
|
* 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 not more than a minute in the past
|
||||||
* and the delta is either greater than -5 seconds or timestamp
|
* 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)
|
* 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
|
* finally check that relative dates are supported by the language pack
|
||||||
*/
|
*/
|
||||||
if ($delta <= 3600 && $delta > -60 && ($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)));
|
return $this->user->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1111,10 +1111,12 @@ function phpbb_tz_select_compare($a, $b)
|
||||||
if ($a_name == $b_name)
|
if ($a_name == $b_name)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
} else if ($a_name == 'UTC')
|
}
|
||||||
|
else if ($a_name == 'UTC')
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
} else if ($b_name == 'UTC')
|
}
|
||||||
|
else if ($b_name == 'UTC')
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue