Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

allow timestamp being a string for date/time formatting

  • Loading branch information...
commit 7501b939800cd7123a832ec6b6be10e17c3bad14 1 parent 346ec67
@craue authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  Twig/Extension/FormatDateTimeExtension.php
View
2  Twig/Extension/FormatDateTimeExtension.php
@@ -151,6 +151,8 @@ protected function getFormattedDateTime($value, $locale, $datetype, $timetype) {
if ($valueToUse instanceof \DateTime) {
// \DateTime::getTimestamp() would return false for year > 2038 on 32-bit systems (https://bugs.php.net/bug.php?id=50590)
$valueToUse = floatval($valueToUse->format('U'));
+ } elseif (is_string($valueToUse)) {
+ $valueToUse = floatval($valueToUse);
}
$localeToUse = !empty($locale) ? $locale : $this->getLocale();
Please sign in to comment.
Something went wrong with that request. Please try again.