Browse Source

Update I18n/Time.php, fix timeAgoInWords(timezone)

Fixed issue with the timezone not being applied in Cake\I18n\Time\timeAgoInWords().
Ícaro R. Scherma 11 years ago
parent
commit
85dd5b4ac7
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/I18n/Time.php

+ 4 - 0
src/I18n/Time.php

@@ -272,6 +272,10 @@ class Time extends Carbon implements JsonSerializable
             }
         }
 
+        if ($timezone) {
+            $this->timezone($timezone);
+        }
+
         $now = $from->format('U');
         $inSeconds = $this->format('U');
         $backwards = ($inSeconds > $now);