From f45f2e4096fc045cfa2c86e4ba757ecf2fd52fa0 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 5 Jan 2011 22:53:56 -0500 Subject: [PATCH] Making niceShort() compare the original dateString and userOffset. This fixes issues where timezone differences would cause the incorrect short form to be displayed. Fixes #1331 --- cake/libs/view/helpers/time.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index 0e04c63380c..1f4d0be1c43 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -226,9 +226,9 @@ function niceShort($dateString = null, $userOffset = null) { $y = $this->isThisYear($date) ? '' : ' %Y'; - if ($this->isToday($date)) { + if ($this->isToday($dateString, $userOffset)) { $ret = sprintf(__('Today, %s',true), strftime("%H:%M", $date)); - } elseif ($this->wasYesterday($date)) { + } elseif ($this->wasYesterday($dateString, $userOffset)) { $ret = sprintf(__('Yesterday, %s',true), strftime("%H:%M", $date)); } else { $format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date);