ZF-5786: Date format conversion from application wide Zend_Locale to javascript format is not correct


In the ZendX_JQuery_View_Helper_DatePicker::_resolveLocaleToDatePickerFormat, the replacement of MMM to M is then override by the replacement of M to m. Thus, a locale with a date format "d MMM yyyy" will produce a date format "d m yy" instead of "d M yy".

Also, order of replacement must begin with larger pattern first : "MMMM" was replaced as it is "M" 4 times.

I have fix this with a quick dirty trick:

$dateFormat = str_replace( array('EEE', 'EEEE', 'MMMM', 'MMM', 'MM', 'M', 'YYYY', 'YY', 'yyyy', '$', '£'), array('D', 'DD', '$$', '$', 'mm', 'm', '££', '£, 'yy', 'M', 'y'), Zend_Locale_Format::getDateFormat($locale) );


duplicate, this bug is fixed in 1.7.5