Sylius/Sylius — pull request #2275 by aramalipoor (2014-12-23 08:35:50+00:00)
Title: [PoC] Add traditional calendar systems support and related twig functions

Q | A
------------- | -------------
Bug fix? | no
New feature? | yes
BC breaks? | no
Deprecations? | no
Fixed tickets | -
License | MIT
Doc PR | -

This is a proposal to add support for traditional calendar systems into Sylius. I'm so new to Symfony2 so please forgive me if you see some bad practices ;)

Your comments are really appreciated ;)

Here is a list of twig functions I've added:
* `date` Override's Twig default date filter with calendar-aware conversion. (Based on current locale. I'm not sure if this is a good idea!!)
* `sylius_language()` Returns localized language name of current locale code.
* `sylius_rtl()` Returns true if current locale code is of an RTL-type language. e.g If current locale is RTL so that we can load RTL stylesheets and whatnot.
* `sylius_direction()` Returns current locale language direction. (`rtl`, `ltr`)
* `sylius_calendar()` Returns current locale calendar system. (`gregorian`, `persian`, `hebrew`, `islamic`, etc)

* I've created a TypeExtension for Symfony's `date` FormType to support calendar-aware dates.