Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8148947

DateTimeFormatter pattern letter 'g'

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b116

      Description

      The CLDR specification includes pattern letter 'g'.
      http://www.unicode.org/reports/tr35/tr35-41/tr35-dates.html#Date_Format_Patterns

      "Modified Julian day. This is different from the conventional Julian day number in two regards. First, it demarcates days at local zone midnight, rather than noon GMT. Second, it is a local number; that is, it depends on the local time zone. It can be thought of as a single number that encompasses all the date-related fields."

      This definition matches the field `JulianFields.MODIFIED_JULIAN_DAY` thus adding it as a new pattern will be easy.

      The documentation of `DateTimeFormatter` must have an additional line added (after "d"). The documentation of `DateTimeFormatterBuilder.appendPattern` must have an additional line added (after "F"). The private method `parseField` must have a new case statement added for "g". The private FIELD_MAP must be updated and the "LDML - g" comment line removed.

      The field should use `appendValue(JulianFields.,MODIFIED_JULIAN_DAY n, 19, SignStyle.NORMAL)` where n is the number of pattern letters.

      While making this change, the method documentation of `DateTimeFormatterBuilder.appendPattern` should have the semicolons removed from the end of each line in the table.

        Activity

        Show
        ntv Nadeesh Tv added a comment - http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-March/039820.html
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/dbb991f84472
        User: ntv
        Date: 2016-04-22 05:47:36 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/dbb991f84472 User: ntv Date: 2016-04-22 05:47:36 +0000
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/dbb991f84472
        User: lana
        Date: 2016-04-27 18:46:47 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/dbb991f84472 User: lana Date: 2016-04-27 18:46:47 +0000

          People

          • Assignee:
            ntv Nadeesh Tv
            Reporter:
            scolebourne Stephen Colebourne
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: