mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-06 07:35:29 +02:00
Allow for tomorrow in relative dates
git-svn-id: file:///svn/phpbb/trunk@6426 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
aa71cfaa8b
commit
17989aba24
@ -1323,12 +1323,17 @@ class user extends session
|
||||
$midnight = gmmktime(0, 0, 0, $m, $d, $y) - $this->timezone - $this->dst;
|
||||
}
|
||||
|
||||
if (strpos($format, '|') === false || (!($gmepoch > $midnight && !$forcedate) && !($gmepoch > $midnight - 86400 && !$forcedate)))
|
||||
if (strpos($format, '|') === false || ($gmepoch < $midnight - 86400 && !$forcedate) || ($gmepoch > $midnight + 172800 && !$forcedate))
|
||||
{
|
||||
return strtr(@gmdate(str_replace('|', '', $format), $gmepoch + $this->timezone + $this->dst), $lang_dates);
|
||||
}
|
||||
|
||||
if ($gmepoch > $midnight && !$forcedate)
|
||||
if ($gmepoch > $midnight + 86400 && !$forcedate)
|
||||
{
|
||||
$format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1);
|
||||
return str_replace('||', $this->lang['datetime']['TOMORROW'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates));
|
||||
}
|
||||
else if ($gmepoch > $midnight && !$forcedate)
|
||||
{
|
||||
$format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1);
|
||||
return str_replace('||', $this->lang['datetime']['TODAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates));
|
||||
|
@ -613,6 +613,7 @@ $lang = array_merge($lang, array(
|
||||
|
||||
'datetime' => array(
|
||||
'TODAY' => 'Today, ',
|
||||
'TOMORROW' => 'Tomorrow, ',
|
||||
'YESTERDAY' => 'Yesterday, ',
|
||||
|
||||
'Sunday' => 'Sunday',
|
||||
|
Loading…
x
Reference in New Issue
Block a user