1

I'm trying to set the format for a jquery datepicker element with the date format returned by Zend_Locale::getTranslationList('date', $locale);

My problem is zend returns the string 'dd/MM/yyyy' for the date format but jquery expects only 2 characters for the year ie 'dd/mm/yy', so it enters the year twice 20112011

Is there some option that can be passed to either zend or jquery to make them work in the same manner? I've read through the docs and can't seem to find anything

Many thanks for your help in advance!

Peter Badida
  • 11,310
  • 10
  • 44
  • 90
JasonM
  • 165
  • 12
  • I just decided to do it with a little post processing. I was just looking for a cleaner way if it was possible – JasonM May 13 '11 at 13:46

2 Answers2

0

I have used jquery date picker in python-django framework when I give date format as dd/mm/yyyy format it returns 20112011 then i have corrected it to dd/mm/yy and it returned 2011 only. you can specify in your datepicker css class to specify the date format as dd/mm/yy.

vkrams
  • 7,267
  • 17
  • 79
  • 129
0

Iam not sure if this is what you're looking for but:

   // use german local, change it to our needs :-)
    $locale = new Zend_Locale('de_DE');
    $result = Zend_Locale::getTranslationList('date', $locale);

    // returns dd.MM.yy (german!)
    echo $result['short'];
opHASnoNAME
  • 20,224
  • 26
  • 98
  • 143
  • Cheers, thats just because the german format that is returned by zend_locale. I should have specified that its the en_GB format (or any other one) that returns yyyy that was the problem. Its not a big deal, i'm doing it with a little extra php, but was just looking for a cleaner way if it existed. Thanks – JasonM May 13 '11 at 13:48