1
0
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:
Graham Eames 2006-10-01 17:18:37 +00:00
parent aa71cfaa8b
commit 17989aba24
2 changed files with 8 additions and 2 deletions

View File

@ -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));

View File

@ -613,6 +613,7 @@ $lang = array_merge($lang, array(
'datetime' => array(
'TODAY' => 'Today, ',
'TOMORROW' => 'Tomorrow, ',
'YESTERDAY' => 'Yesterday, ',
'Sunday' => 'Sunday',