Skip to content

Commit

Permalink
Fixed issue in CakeTime that it would apply userOffset twice when using
Browse files Browse the repository at this point in the history
the format() function
  • Loading branch information
lorenzo committed Sep 25, 2012
1 parent b0822d2 commit 6818d69
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/Cake/Utility/CakeTime.php
Expand Up @@ -941,15 +941,11 @@ public static function gmt($dateString = null) {
* @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);
}
Expand Down

0 comments on commit 6818d69

Please sign in to comment.