AJS.format doesn't handle negative numbers or extra whitespace in choice format

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • Component/s: None

      NOTE: This bug report is for JIRA Software Cloud. Using JIRA Software Server? See the corresponding bug report.

      The Java ChoiceFormat documentation has an example pattern:

      "{0,choice,-1#is negative| 0#is zero or fraction | 1#is one |1.0<is 1+ |2#is two |2<is more than 2.}"
      

      As of AUI 5.3, AJS.format() supports ChoiceFormat, but that example will break with an error of "Cannot read property '1' of null"

      There are two different parts that break, due to the format of the regexes inside AJS.format():

      • Negative number
      • Whitespace surrounding the "|" characters

            Assignee:
            Unassigned
            Reporter:
            Gilmore Davidson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: