aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Smith <toonarmy@phpbb.com>2010-04-20 19:30:05 +0100
committerOleg Pudeyev <oleg@bsdpower.com>2012-03-14 22:57:29 -0400
commita5c3ff376911f2f25595f1a540c7a16395dac67d (patch)
tree3862b2c54f371186497fde5220c56facfa982b91
parente8b60fc3d8b483fda50c715e59b73861cd3ced9e (diff)
downloadforums-a5c3ff376911f2f25595f1a540c7a16395dac67d.tar
forums-a5c3ff376911f2f25595f1a540c7a16395dac67d.tar.gz
forums-a5c3ff376911f2f25595f1a540c7a16395dac67d.tar.bz2
forums-a5c3ff376911f2f25595f1a540c7a16395dac67d.tar.xz
forums-a5c3ff376911f2f25595f1a540c7a16395dac67d.zip
[feature/new-tz-handling] Renamed old variables and removed extra conditional.
PHPBB3-9558
-rw-r--r--phpBB/includes/datetime.php43
1 files changed, 19 insertions, 24 deletions
diff --git a/phpBB/includes/datetime.php b/phpBB/includes/datetime.php
index d14693faa3..92aef88599 100644
--- a/phpBB/includes/datetime.php
+++ b/phpBB/includes/datetime.php
@@ -87,32 +87,27 @@ class phpbb_datetime extends DateTime
$midnight = clone $now;
$midnight->setTime(0, 0, 0);
- $midnight = $midnight->getTimestamp();
- $gmepoch = $this->getTimestamp();
+ $midnight = $midnight->getTimestamp();
+ $timestamp = $this->getTimestamp();
- if (!($gmepoch < $midnight - 86400 || $gmepoch > $midnight + 172800))
+ if ($timestamp > $midnight + 86400)
{
- $day = false;
-
- if ($gmepoch > $midnight + 86400)
- {
- $day = 'TOMORROW';
- }
- else if ($gmepoch > $midnight)
- {
- $day = 'TODAY';
- }
- else if ($gmepoch > $midnight - 86400)
- {
- $day = 'YESTERDAY';
- }
-
- if ($day !== false)
- {
- $format = self::_format_cache($format, $this->_user);
-
- return str_replace(self::RELATIVE_WRAPPER . self::RELATIVE_WRAPPER, $this->_user->lang['datetime'][$day], strtr(parent::format($format['format_short']), $format['lang']));
- }
+ $day = 'TOMORROW';
+ }
+ else if ($timestamp > $midnight)
+ {
+ $day = 'TODAY';
+ }
+ else if ($timestamp > $midnight - 86400)
+ {
+ $day = 'YESTERDAY';
+ }
+
+ if ($day !== false)
+ {
+ $format = self::_format_cache($format, $this->_user);
+
+ return str_replace(self::RELATIVE_WRAPPER . self::RELATIVE_WRAPPER, $this->_user->lang['datetime'][$day], strtr(parent::format($format['format_short']), $format['lang']));
}
}
}