Skip to content
Permalink
Browse files

transform immutable datetime to mutable when using the time helper

  • Loading branch information...
antograssiot committed Jan 31, 2016
1 parent 0f4aa41 commit 37503b1dd7115c8cdf04523bbbb38738b4b38c40
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/View/Helper/TimeHelper.php
@@ -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);

0 comments on commit 37503b1

Please sign in to comment.
You can’t perform that action at this time.