Skip to content

Commit

Permalink
transform immutable datetime to mutable when using the time helper
Browse files Browse the repository at this point in the history
  • Loading branch information
antograssiot committed Jan 31, 2016
1 parent 0f4aa41 commit 37503b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/View/Helper/TimeHelper.php
Expand Up @@ -333,6 +333,10 @@ public function i18nFormat($date, $format = null, $invalid = false, $timezone =
return $invalid;
}

if ($date instanceof \DateTimeImmutable) {
$date = $date->toMutable();
}

try {
$time = new Time($date);
return $time->i18nFormat($format, $timezone);
Expand Down

0 comments on commit 37503b1

Please sign in to comment.