You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Martin Gonzalez (JIRA)" <ji...@apache.org> on 2014/10/10 23:57:34 UTC

[jira] [Commented] (CB-7766) [Android][Globalization] android date value obtained through dateToString, is not well formatted

    [ https://issues.apache.org/jira/browse/CB-7766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14167607#comment-14167607 ] 

Martin Gonzalez commented on CB-7766:
-------------------------------------

I have investigate this matter and found some information about it.

Cordova uses the android API to get the date pattern from the user preferences, and no one of them is completely following ICU standard pattern. Android uses UTS#35 standard to set the date format.
e.g.
Android 4.4.2, provides 4 options about the date format:
EN_us:

Regional 10/9/2014
10/09/2014
09/10/2014
2014/10/09

That being said, the android date pattern is not completely aligned to the ICU standard, SHORT format(default and the one used on app diagnostic) for android is yyyy-mm-dd, not yy-mm-dd, meaning that natively the android platform returns which its own pattern defined in the OS, and the pattern that is currently selected by the user. No one of those formats on android look like: yy-mm-dd, the year value always has 4 digits.

In conclusion, android platform is not aligned to the ICU standard in the matter of date pattern, and modify or add code to the globalization plugin to just align something like this; cannot the right workaround. It would be a breaking change. I strongly suggest to keep the date format that the platform is providing(selected by the user anyway), in any case, the platform itself is the one that it should be aligned to ICU standard, we shouldn't be adding, special code to fix this alignment and break something else.

I'll add a quirk note about this subject for future references and clarifications about this matter.

> [Android][Globalization] android date value obtained through dateToString, is not well formatted 
> -------------------------------------------------------------------------------------------------
>
>                 Key: CB-7766
>                 URL: https://issues.apache.org/jira/browse/CB-7766
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Plugin Globalization
>    Affects Versions: 3.6.0
>            Reporter: Martin Gonzalez
>            Assignee: Martin Gonzalez
>            Priority: Minor
>              Labels: android, datetime, globalization
>             Fix For: 3.7.0
>
>
> The android date format is not rightly aligned to ICU standard, when dateToString is called with 'formatLength' as 'short' or default.
> It shows 'yyyy-mm-d' not ICU format "yy/M/d".
> http://demo.icu-project.org/icu-bin/locexp?d_=en_US&_=en_US



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org