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

DateTimeFormatter : No argumentError when setting dateStyle/timeStyle/dateTimePattern as an invalid value .

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • Adobe Flex SDK Previous
    • None
    • Spark: Formatters
    • None
    • Affected OS(s): All OS Platforms
      Language Found: English

    Description

      When setting dateStyle/TimeStyle/dateTimepattern as an invalid value , for example , dtfFormat.timeStyle="abcde" ;
      GSLib will throw the following error :

      ArgumentError: Error #2008: Parameter DateTimeFormatterStyle must be one of the accepted values.

      However , spark DateTimeFormatter cannot throw this argumentError. Please see the following code to reproduce the issue:

      ===========
      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      creationComplete="init()"
      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
      <fx:Script>
      <![CDATA[
      import flash.globalization.DateTimeFormatter ;
      import spark.formatters.DateTimeFormatter ;

      public var dfgslib:flash.globalization.DateTimeFormatter ;
      public var dtfFormat:spark.formatters.DateTimeFormatter ;

      private var errorStr:String;

      private var gslibErrStr:String;

      public function init () {
      try

      { dfgslib = new flash.globalization.DateTimeFormatter( 'en_US','long', "abcd"); }

      catch(e:Error)

      { gslibErrStr = e.toString(); }

      try

      { dtfFormat = new spark.formatters.DateTimeFormatter( ); dtfFormat.dateStyle = "long" ; dtfFormat.timeStyle = "abcd" ; }

      catch(e:Error)

      { errorStr = e.toString(); }

      trace ( "-------- error from gslib -----" ) ;
      trace(gslibErrStr);
      trace ( "-------- error from spark -----" ) ;
      trace(errorStr);
      }
      ]]
      >
      </fx:Script>

      <fx:Declarations>

      </fx:Declarations>
      </s:Application>
      ===========

      the output result is :
      -------- error from gslib -----
      ArgumentError: Error #2008: Parameter DateTimeFormatterStyle must be one of the accepted values.
      -------- error from spark -----
      null

      We use the latest flex sdk, changlist: #13064

      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: