skip to content

Datepicker in Symfony with i18n

Datepickers internationalized in Sf1.4, how to implement

Some time ago we decided in Makoondi that would be better to have one of these jQuery calendars where the user picks the date:


The first version was easy to implement with sfFormExtraPlugin , that implements sfWidgetFormJQueryDate.

$this->setWidget('available_from', new sfWidgetFormJQueryDate(array(
                        'culture' => sfContext::getInstance()->getUser()->getCulture(),
                        'format' => '%day%/%month%/%year%')

You will need, apart from the plugin, some jquery files that you can download from the jquery-ui website:


and, in order to use the i18n, you will need the localized version of jpicker from this website. e. g. the file with translations to Spanish would be:


But be aware! you will need to change mentions to $.datepick to $datepicker in that file in order to get it working!

$.datepicker.regional['es'] = {

otherwise you will get a ”$.datepick is undefined” error :(