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

Spark DateTimeFormatter ignores dateStyle/timeStyle assignments when it involves "custom" value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • Adobe Flex SDK 4.5.1 (Release)
    • None
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:

      Run following script and see the behavior.

      var dtf:DateTimeFormatter = new DateTimeFormatter();

      dtf.setStyle("locale", "en_US");
      dtf.dateStyle = "long";
      dtf.timeStyle = "short";
      dtf.dateTimePattern = "yyyy.MM.dd";
      dtf.dateStyle = "long"; // Setting the same style with the earlier.

      trace("dateStyle: " + dtf.dateStyle); // "custom" (WRONG. Should be "long")
      trace("timeStyle: " + dtf.timeStyle); // "custom" (WRONG. Should be "short")
      trace("dateTimePattern: " + dtf.dateTimePattern); // "yyyy.MM.dd" (Wrong. Should be "MMMM d, yyyy h:mm a")

      Actual Results:
      The second dateStyle assignment is totally ignored; the property keeps the value "custom" and the dateTimePattern also keeps the same value "yyyy.MM.dd".

      Expected Results:
      The second dateStyle assignment should make the following effects:
      dateStyle <-- "long"
      timeStyle <-- "short"
      dateTimePattern <-- ""MMMM d, yyyy h:mm a"

      Workaround (if any):
      Set the dateStyle to some different value from the earlier and then set the real desired value.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: