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

DateTimeFormatter : No typeError when setting dateStyle/TimeStyle/datetimePattern as null

    XMLWordPrintableJSON

Details

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

    Description

      When setting dateStyle/TimeStyle/DateTimePattern as null , there is no TypeError as GSLib output.
      Please see the sample code :
      ==================
      <?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', null); }

      catch(e:Error)

      { gslibErrStr = e.toString(); }

      try

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

      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>
      ======================
      I attached sample code to reproduce it .

      The output results is :

      -------- error from gslib -----
      TypeError: Error #2007: Parameter timeStyle must be non-null.
      -------- error from spark -----
      null

      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: