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

XMLWordPrintable

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

      NOTE: This bug report is for JIRA Software Server. Using JIRA Software Cloud? 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: