mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
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:
parent
6e2ffafe54
commit
f45f2e4096
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue