Issues

ZF-5909: datePicker prints wrong month names in UK locale

Description


$date = new Zend_Date('2009-02-01', 'yyyy-MM-dd');
            
$locale = new Zend_Locale('uk');
$dateFormat = Zend_Locale_Format::getDateFormat($locale); // 'd MMM yyyy'

print $date->get($dateFormat); // prints '1 лют. 2009'

But when I choose that date on the calendar, in the field appears '1 Лют 2009' and date parsing fails


$locale = new Zend_Locale('uk');
$dateFormat = Zend_Locale_Format::getDateFormat($locale);// 'd MMM yyyy'
$date = $_GET['date']; // '1 Лют 2009'
$filterFromDate = new Zend_Date(date, $dateFormat); // <-- fails

Comments

You can see the reason yourself.

In uk the month 2 with MMM notation is defined as 'лют.' As $_GET returns only 'Лют' which is not the correct notation, the abbreviated month is not detected and therefor the date is invalid.

But in the localization normally come in JQuery UI (http://jqueryui.com/ui/i18n/ui.datepicker-uk.js), using the name of the month "Лют", not "лют.". So this is an error jQuery and should write about it to them?

Based on the format of dates in the 'd MMM yyyy' in Zend/Locale/Data/ua.xml (dateFormatLength type="medium") and the code of ZendX_JQuery_View_Helper_DatePicker::resolveZendLocaleToDatePickerFormat, in "ui.datepicker-uk.js" must be abbreviated names from months/monthContext[@type="format"]/monthWidth[@type="abbreviated"], it's right?

That's right.

MMM is defined as context - format and width - abbreviated. But DatePicker returns the context - standalone which does not conform MMM.

Therefor MMM is not recognised as valid input even if it's in this language only a dot. In other languages the standalone format are complete different words.

Ticket on jQuery.UI.DatePicker: http://dev.jqueryui.com/ticket/4254

Resolving is scheduled for version 1.8 of jQuery UI (currently stable version is 1.7.1).

So, that had hitherto not possible to fully enjoy the datepicker component on locale-aware or simply multilanguage sites, where needs to use UK-locale

I mark this as not an issue for the ZFX JQuery, since the bug is jQuery UI DatePicker related.