Permalink
Browse files

Making niceShort() compare the original dateString and userOffset. Th…

…is fixes issues where timezone differences would cause the incorrect short form to be displayed. Fixes #1331
  • Loading branch information...
1 parent 6e2ffaf commit f45f2e4096fc045cfa2c86e4ba757ecf2fd52fa0 @markstory markstory committed Jan 6, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 cake/libs/view/helpers/time.php
View
4 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);

0 comments on commit f45f2e4

Please sign in to comment.