mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixed issue in CakeTime that it would apply userOffset twice when using
the format() function
This commit is contained in:
parent
b0822d2246
commit
6818d69fc3
1 changed files with 3 additions and 7 deletions
|
@ -941,15 +941,11 @@ class CakeTime {
|
|||
* @see CakeTime::i18nFormat()
|
||||
*/
|
||||
public static function format($date, $format = null, $default = false, $timezone = null) {
|
||||
//Backwards compatible params order
|
||||
//Backwards compatible params re-order test
|
||||
$time = self::fromString($format, $timezone);
|
||||
$_time = is_numeric($time) ? false : self::fromString($date, $timezone);
|
||||
|
||||
if (is_numeric($_time) && $time === false) {
|
||||
return self::i18nFormat($_time, $format, $default, $timezone);
|
||||
}
|
||||
if ($time === false && $default !== false) {
|
||||
return $default;
|
||||
if ($time === false) {
|
||||
return self::i18nFormat($date, $format, $default, $timezone);
|
||||
}
|
||||
return date($date, $time);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue