Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-16365

DateFormatter issue when entering 0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Adobe Flex SDK 3.0 (Release)
    • None
    • Formatters
    • None
    • Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:
      1. Run the attached mxml in FB.
      2. Type 0 in the text field and press Go button.
      3. The result after formatting the "0" is an empty string

      Actual Results: Empty string instead of "01-Jan-1970"

      Expected Results: "01-Jan-1970".
      "0" is a valid value as it indicates the begining of 1970 as Date.toString for entering "0" shows Thu Jan 1 00:00:00 GMT+0000 1970.
      Please note if you type "-1" it works find and shows Formatted Date:31-Dec-1969 and the Date.toString value is :Wed Dec 31 23:59:59 GMT+0000 1969

      Workaround (if any): I do not think this is a good workaround but it may be helpful to fix this issue :
      Create a class that inherits DateFormatter class and overwrite this method : override public function format(value:Object):String
      instead of "if (!value || value)" have "if ((!value || value == "") && ( value != "0"))". Then you also have to redefine : private static const VALID_PATTERN_CHARS:String = "Y,M,D,A,E,H,J,K,L,N,S"; which I do not think is a good idea.

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: