Skip to content

Commit

Permalink
Making niceShort() compare the original dateString and userOffset. Th…
Browse files Browse the repository at this point in the history
…is fixes issues where timezone differences would cause the incorrect short form to be displayed. Fixes #1331
  • Loading branch information
markstory committed Jan 6, 2011
1 parent 6e2ffaf commit f45f2e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cake/libs/view/helpers/time.php
Expand Up @@ -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);
Expand Down

0 comments on commit f45f2e4

Please sign in to comment.