library twig-strftime-extension
use strftime function in twig
anders/twig-strftime-extension
use strftime function in twig
- Wednesday, September 13, 2017
- by anders2014
- Repository
- 0 Watchers
- 0 Stars
- 7 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 5 Forks
- 0 Open issues
- 3 Versions
- 17 % Grown
Twig strftime Filter
Use strftime in twig, (*1)
{{ now|date_modify("+3 day")|strftime('%A') }} //-> Monday (if today is thursday at least :) )
{{ date()|strftime('%I:%M:%S %p') }} //-> Display the current time
Installation
composer require teraone/twig-strftime-extension
Add the extension to your twig environment, (*2)
// set your locale
setlocale(LC_ALL, 'de_DE');
$twig->addExtension(new Teraone\Twig\Extension\StrftimeExtension());
// optional: set Timezone
$twig->getExtension('core')->setTimezone('Europe/Berlin');
For the full list of supported time formats have a look at the PHP strftime documentation, (*3)
dev-master
9999999-dev
use strftime function in twig
Sources
Download
MIT
The Requires
The Development Requires
1.1.0
1.1.0.0
use strftime function in twig
Sources
Download
MIT
The Requires
The Development Requires
1.0.1
1.0.1.0
use strftime function in twig
Sources
Download
MIT
The Requires
The Development Requires