Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-1344

fixed multiple issues with convertDateTime's handling of convenience patterns

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.10-core, 1.0.10-core
    • 1.0.11-core, 1.2.11-core
    • Components
    • None

    Description

      The provided 1.2.10.1_convPatterns.patch fixes multiple issues with convertDateTime's handling of convenience patterns; convenience patterns are patterns we try to match if the user input doesn't match the default date pattern.

      Resolved issues are:

      1. order of convenience patterns is incorrect: 12-10-08 ==> October 12, 2008

      ["MMMM dd, yy", "dd-MMMM-yy", "MMMM/dd/yy"]

      should be:
      ["MMMM dd, yy", "MMMM/dd/yy", "dd-MMMM-yy"]

      (at least for en_US locale, we want to first try matching patterns of order "month day year")

      2. convenience patterns left out of lenience patterns list on server

      That is, the convenience patterns ["MMMM dd, yy", "dd-MMMM-yy", "MMMM/dd/yy"] do not show up in the lenience patterns list (only the lenient pattern variants show up).
      i.e. "MMMM dd, yy" is not present, but "MMM dd, yy" and "MM dd, yy" are present.

      3. Furthermore, the final pattern list order was:

      "MMMM dd, yy", "dd-MMMM-yy", "MMMM/dd/yy"... which is WRONG. The lenience patterns should be inserted after each corresponding convenience pattern. I.e. "MMMM dd, yy", "MMM dd, yy", "MM dd, yy"... This is because the lenience patterns for the default pattern should take precedence (and in general the convenience patterns should be ordered according to precedence).

      I.e. Given convenience patterns ["MMMM dd, yy", "MMMM/dd/yy", "dd-MMMM-yy"], then on the server and client, the constructed list of patterns we check is:

      "MMMM dd, yy"
      "MMM dd, yy"
      "MM dd, yy"
      "MMMM/dd/yy"
      "MMM/dd/yy"
      "MM/dd/yy"
      "MMMM-dd-yy"
      "MMM-dd-yy"
      "MM-dd-yy"
      "MMMM.dd.yy"
      "MMM.dd.yy"
      "MM.dd.yy"
      "dd-MMMM-yy"
      "dd-MMM-yy"
      "dd-MM-yy"
      "dd/MMMM/yy"
      "dd/MMM/yy"
      "dd/MM/yy"
      "dd.MMMM.yy"
      "dd.MMM.yy"
      "dd.MM.yy"

      4. There was no "locale"==>"convenience patterns" map on the client.

      I added this map to the client, and added comments to both the client and server map stating that these maps MUST be equivalent to one another.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jeanne.waldman@oracle.com Jeanne Waldman
            cale.scholl Cale Scholl
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment