added export module (#538)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user