Issues

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

Issue Type: Bug Created: 2010-03-11T05:51:40.000+0000 Last Updated: 2010-04-16T00:51:40.000+0000 Status: Resolved Fix version(s): - 1.10.4 (28/Apr/10)

Reporter: Nikolay Slunkov (grafsl) Assignee: Benjamin Eberlei (beberlei) Tags: - ZendX_JQuery

Related issues: Attachments:

Description

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

<pre class="highlight"> 
$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):

<pre class="literal">
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' :

<pre class="highlight">
$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

Posted by Benjamin Eberlei (beberlei) on 2010-04-16T00:51:39.000+0000

Fixed

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts