cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gonzalez (JIRA)" <>
Subject [jira] [Commented] (CB-7766) [Android][Globalization] android date value obtained through dateToString, is not well formatted
Date Fri, 10 Oct 2014 21:57:34 GMT


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.
Android 4.4.2, provides 4 options about the date format:

Regional 10/9/2014

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

> [Android][Globalization] android date value obtained through dateToString, is not well
> -------------------------------------------------------------------------------------------------
>                 Key: CB-7766
>                 URL:
>             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".

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message