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

        scolebourne Stephen Colebourne created issue -
        rriggs Roger Riggs made changes -
        Field Original Value New Value
        Assignee Roger Riggs [ rriggs ]
        ntv Nadeesh Tv (Inactive) made changes -
        Assignee Roger Riggs [ rriggs ] Nadeesh Tv [ ntv ]
        ntv Nadeesh Tv (Inactive) made changes -
        Status New [ 10000 ] Open [ 1 ]
        ntv Nadeesh Tv (Inactive) made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Understanding Fix Understood [ 10001 ]
        evotchen Elena Votchennikova (Inactive) made changes -
        Link This issue relates to JCK-7306306 [ JCK-7306306 ]
        hgupdate HG Updates made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolved In Build team [ 17324 ]
        Understanding Fix Understood [ 10001 ]
        Fix Version/s 9 [ 14949 ]
        Resolution Fixed [ 1 ]
        hgupdate HG Updates made changes -
        Resolved In Build team [ 17324 ] master [ 18256 ]
        hgupdate HG Updates made changes -
        Resolved In Build master [ 18256 ] b116 [ 17844 ]
        iris Iris Clark made changes -
        Labels jsr379-annex2-tbd
        iris Iris Clark made changes -
        Labels jsr379-annex2-tbd jsr379-annex1
        darcy Joe Darcy made changes -
        Link This issue csr of CCC-8148947 [ CCC-8148947 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: