0

i have quick questions: i need to set the month dates on my form to English settings; they are curretnly set in Romanian Langugauge

i followed the example set by bakura10 / gist:3705417 and set my dates as such:

$this->add(array(
    'type'    => 'Zend\Form\Element\DateSelect',
    'name'    => 'birthDate',
    'options' => array(
        'label'               => 'Date',
        'create_empty_option' => true,
        'day_attributes'      => array(
            'data-placeholder' => 'Day',
            'style'            => 'width: 20%',
        ),
        'month_attributes'    => array(
            'data-placeholder' => 'Month',
            'style'            => 'width: 20%',
        ),
        'year_attributes'     => array(
            'data-placeholder' => 'Year',
            'style'            => 'width: 20%',
        )
    )
));

i then set my view helper as such;

echo $this->formDateSelect($this->form->get('birthDate'), IntlDateFormatter::LONG, 'ro_RO');

the problem is that this obviously gives me romanian setting; i dont know where to get the settings for English; i tried this but it does not work;

echo $this->formDateSelect($this->form->get('birthDate'), IntlDateFormatter::LONG, 'en');
paul kendal23
  • 171
  • 2
  • 3
  • 14
  • 2
    Have you tried just omitting the locale? `echo $this->formDateSelect($this->form->get('birthDate'), IntlDateFormatter::LONG);` failing that, try `en_US` or `en_GB` as the locale parameter. – Crisp May 09 '14 at 10:26
  • Hello Crisp. thank you so much for your help. it worked. Where did you get the list from, i.e the en_us list – paul kendal23 May 09 '14 at 10:38
  • There's a list right here on SO -> http://stackoverflow.com/questions/3191664/list-of-all-locales-and-their-short-codes – Crisp May 09 '14 at 10:44
  • Thanks Crips. huge debt of gratitude to you – paul kendal23 May 09 '14 at 10:55

0 Answers0