Browse files

Added Capability to format DateInterval via twig date filter

  • Loading branch information...
1 parent f96d8d8 commit 5fa00942ddb62337a008a1a040e2eabe37215b6d @phiamo phiamo committed Sep 29, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Twig/Extension/Core.php
View
2 lib/Twig/Extension/Core.php
@@ -221,7 +221,7 @@ function twig_cycle($values, $i)
*/
function twig_date_format_filter($date, $format = 'F j, Y H:i', $timezone = null)
{
- if (!$date instanceof DateTime) {
+ if (!$date instanceof DateTime && !$date instanceof DateInterval) {
if (ctype_digit((string) $date)) {
$date = new DateTime('@'.$date);
$date->setTimezone(new DateTimeZone(date_default_timezone_get()));

0 comments on commit 5fa0094

Please sign in to comment.