added export module (#538)

This commit is contained in:
Kevin Papst
2019-02-05 21:37:33 +01:00
committed by GitHub
parent 062735c9e3
commit 816866549c
104 changed files with 3770 additions and 608 deletions

View File

@@ -39,6 +39,7 @@ class DateExtensions extends \Twig_Extension
return [
new TwigFilter('month_name', [$this, 'monthName']),
new TwigFilter('date_short', [$this, 'dateShort']),
new TwigFilter('date_time', [$this, 'dateTime']),
];
}
@@ -53,6 +54,17 @@ class DateExtensions extends \Twig_Extension
return date_format($date, $format);
}
/**
* @param DateTime $date
* @return string
*/
public function dateTime(DateTime $date)
{
$format = $this->localeSettings->getDateTimeFormat();
return date_format($date, $format);
}
/**
* @param \DateTime $date
* @return string