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

This commit is contained in:
mark_story 2011-01-05 22:53:56 -05:00
parent 6e2ffafe54
commit f45f2e4096

View file

@ -226,9 +226,9 @@ class TimeHelper extends AppHelper {
$y = $this->isThisYear($date) ? '' : ' %Y'; $y = $this->isThisYear($date) ? '' : ' %Y';
if ($this->isToday($date)) { if ($this->isToday($dateString, $userOffset)) {
$ret = sprintf(__('Today, %s',true), strftime("%H:%M", $date)); $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)); $ret = sprintf(__('Yesterday, %s',true), strftime("%H:%M", $date));
} else { } else {
$format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date); $format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date);