Friday 15 April 2011

php - Translate month in Symfony 2 date field -


I am working on the SF2 2.6.4 project. I have created a form and added a date type component (birthday field type to be exact).

I set it up like this:

  'widget' = & gt; 'Options', 'Format' = & gt; 'DdMMMMyyy',  

Format output

  18 March 2015  

I have to translate the month.

During my research, I noticed that Symfony \ Component \ Form \ Extension \ Core \ Type \ DateType class hardcode \ locale :: getDefault () Variable system.

So what do I have to do? Is there a better idea of ​​changing my date format?

Thx

Generally if you are enabled in your intl PHP (phpinfo) So translate the months according to your local configuration, try setting the locale before creating your form in this way:

  Setlokel (LCTMEM, "FRFF");  

If this does not help, then another option is:

You can use Data Time Assistant


No comments:

Post a Comment