Symfony2 PersianDateBundle
composer require mtm/persian-date-bundle:1.0.4
add following line to your AppKernel.php
new Mtm\PersianDateBundle\MtmPersianDateBundle(),
This bundle comes with a mtm_persian_date_type
form type which prompt user
for persian date at view layer and converts it to Standard PHP DateTime object at business layer.
So you can use Standard PHP DateTime object as form data.
Here is how to use it:
$dateTime = new \DateTime('tomorrow');
$this->createForm('mtm_persian_date_type', $dateTime);
This bundle also adds a very handy twig filter persian_date
to format Standard PHP DateTime object.
<td>
{{ post.createdAt| persian_date("Y-m-d') }}
</td>