1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 03:34:04 +02:00

[ticket/16823] Make datetime class correctly handle edge cases

PHPBB3-16823
This commit is contained in:
rxu
2021-07-20 20:35:04 +07:00
parent 19a5900db5
commit e1fc0a9059
2 changed files with 17 additions and 4 deletions

View File

@@ -101,15 +101,15 @@ class datetime extends \DateTime
{
$day = false;
if ($timestamp > $midnight + 86400)
if ($timestamp >= $midnight + 86400)
{
$day = 'TOMORROW';
}
else if ($timestamp > $midnight)
else if ($timestamp >= $midnight)
{
$day = 'TODAY';
}
else if ($timestamp > $midnight - 86400)
else if ($timestamp >= $midnight - 86400)
{
$day = 'YESTERDAY';
}