Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13178

Single character y returned for year in getDatePattern

    XMLWordPrintableJSON

Details

    Description

      The following code:

      navigator.globalization.dateToString(new Date(), (obj) => {
      	console.log(obj.value);
      }, null, {
      	formatLength: 'medium',
      	selector: 'date'
      });
      

      Returns Aug 14, 2017.

      The following code:

      navigator.globalization.getDatePattern((obj) => {
      	console.log(obj.pattern);
      }, null, {
      	formatLength: 'medium',
      	selector: 'date'
      });
      

      Returns MMM d, y.

      According to the UTR#35 spec this should return yyyy and not y for the year.

      Locale is set to English (United States)

      Attachments

        Activity

          People

            bowserj Joey Robert Bowser
            cookieguru Tim Bond
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: