Yii Framework Forum: Cdatetimeparser Does Not Support 'y' - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cdatetimeparser Does Not Support 'y' Rate Topic: -----

#1 User is offline   G. Miliotis 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 16-February 13

Posted 21 November 2013 - 03:26 PM

CDateTimeParser converts dates from a format to a timestamp. Trying to use the internal locate dateFormat for french resulted in errors. After further investigation I found that the locales in Yii, as used by CDateFormatter use the table at unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns

In that table, 'y' is defined as the year. French locale (and many others) define the format 'd MMM y'. This format cannot be parsed by CDateTimeParser.

I have added the 'y' option to CDateTimeParser in my copy to be handled the same as 'yyyy'. I believe this should be fixed in yii and any other useful entries in UTS#35 also be matched.

My original reason for getting into this was trying to use an i18n-enabled jui datetime picker.

Using yii 1.1.14
0

#2 User is offline   RandomWhiteTrash 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 05-October 11

Posted 08 January 2014 - 09:56 AM

I concur, same here.
i18n files supplied with Yii specify for e.g. full date format for en_gb to be 'EEE, d MMMM y' but CDatetimeParser can not parse it because there is no 'y' support, only 'yyyy' and 'yy'.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users