You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Tim Bond (JIRA)" <ji...@apache.org> on 2017/08/14 19:15:00 UTC

[jira] [Created] (CB-13178) Single character y returned for year in getDatePattern

Tim Bond created CB-13178:
-----------------------------

             Summary: Single character y returned for year in getDatePattern
                 Key: CB-13178
                 URL: https://issues.apache.org/jira/browse/CB-13178
             Project: Apache Cordova
          Issue Type: Bug
          Components: cordova-android, cordova-plugin-globalization
         Environment: Android 7.1.2, Google Pixel
cordova-plugin-globalization version 1.0.7
            Reporter: Tim Bond
            Assignee: Joe Bowser


The following code:
{code:javascript}
navigator.globalization.dateToString(new Date(), (obj) => {
	console.log(obj.value);
}, null, {
	formatLength: 'medium',
	selector: 'date'
});
{code}
Returns {{Aug 14, 2017}}.

The following code:
{code:javascript}
navigator.globalization.getDatePattern((obj) => {
	console.log(obj.pattern);
}, null, {
	formatLength: 'medium',
	selector: 'date'
});
{code}
Returns {{MMM d, y}}.

According to the [UTR#35 spec|http://unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns] this should return {{yyyy}} and not {{y}} for the year.

Locale is set to English (United States)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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