Make sure the "classic" page uses the transformer as well.

This commit is contained in:
James Cole
2018-02-06 18:11:33 +01:00
parent 9a0672e359
commit c4507a7f75
5 changed files with 78 additions and 43 deletions

View File

@@ -65,6 +65,7 @@ class General extends Twig_Extension
$this->steamPositive(),
$this->activeRoutePartial(),
$this->activeRoutePartialWhat(),
$this->formatDate(),
];
}
@@ -179,6 +180,21 @@ class General extends Twig_Extension
);
}
/**
* @return Twig_SimpleFunction
*/
protected function formatDate()
{
return new Twig_SimpleFunction(
'formatDate',
function (string $date, string $format): string {
$carbon = new Carbon($date);
return $carbon->formatLocalized($format);
}
);
}
/**
* @return Twig_SimpleFilter
*/