Issues

ZF-9402: Wrong date format convertation for years in ZendX_JQuery_View_Helper_DatePicker::resolveZendLocaleToDatePickerFormat

Description

There are two errors in convertation table in function ZendX_JQuery_View_Helper_DatePicker::resolveZendLocaleToDatePickerFormat :

 
$dateFormat = array(
            'EEEEE' => 'D', 'EEEE' => 'DD', 'EEE' => 'D', 'EE' => 'D', 'E' => 'D',
            'MMMM' => 'MM', 'MMM' => 'M', 'MM' => 'mm', 'M' => 'm',
            'YYYYY' => 'yy', 'YYYY' => 'yy', 'YYY' => 'yy', 'YY' => 'y', 'Y' => 'y',
            'yyyyy' => 'yy', 'yyyy' => 'yy', 'yyy' => 'yy', 'yy' => 'y',
            'G' => '', 'e' => '', 'a' => '', 'h' => '', 'H' => '', 'm' => '',
            's' => '', 'S' => '', 'z' => '', 'Z' => '', 'A' => '',
        );

in documentation http://framework.zend.com/manual/en/… section 'Year Constants' and source code (Zend_Date):

Constant                   Constant value  Description                   Result
Zend_Date::YEAR            'y'             Year (number)                 2009
Zend_Date::YEAR_8601       'Y'             Year according to ISO 8601    2009
Zend_Date::YEAR_SHORT      'yy'            Year (number, two digits)     09
Zend_Date::YEAR_SHORT_8601 'YY'            Year according to ISO 8601    09

in DatePicker description http://docs.jquery.com/UI/Datepicker/formatDate :

y - year (two digit)

yy - year (four digit)

so the date constants Zend_Date::YEAR('y') and Zend_Date::YEAR_8601('Y') should be converted into 'yy' :


$dateFormat = array(
            'EEEEE' => 'D', 'EEEE' => 'DD', 'EEE' => 'D', 'EE' => 'D', 'E' => 'D',
            'MMMM' => 'MM', 'MMM' => 'M', 'MM' => 'mm', 'M' => 'm',
            'YYYYY' => 'yy', 'YYYY' => 'yy', 'YYY' => 'yy', 'YY' => 'y', 'Y' => 'yy', 
            'yyyyy' => 'yy', 'yyyy' => 'yy', 'yyy' => 'yy', 'yy' => 'y', 'y' => 'yy', 
            'G' => '', 'e' => '', 'a' => '', 'h' => '', 'H' => '', 'm' => '',
            's' => '', 'S' => '', 'z' => '', 'Z' => '', 'A' => '',
        );

Comments

Fixed