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

DateTimeFormatter: formate method return wrong value for some invalid and big year date.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Adobe Flex SDK Previous
    • None
    • Spark: Formatters
    • None
    • Affected OS(s): All OS Platforms
      Browser: Firefox 3.x
      Language Found: English

    Description

      Steps to reproduce:
      Run the following sample code with the latest flex sdk ( redcloud://esg/flex/sdk/gs changelist:13038 )
      ------------
      <?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="testFormat()"
      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
      <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
      <s:DateTimeFormatter id="dtf" dateTimePattern="h:mm a" />
      </fx:Declarations>
      <fx:Script>
      <![CDATA[
      import flash.globalization.DateTimeFormatter;
      import spark.formatters.DateTimeFormatter;

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

      public function testFormat():void

      { var date:Date = new Date(30000000, 11, 31, 23, 59, 59, 935); dfgslib = new flash.globalization.DateTimeFormatter('en-US' ) ; dfgslib.setDateTimePattern("h:mm a" ) ; trace ("------- format from gslib -----" ) ; trace( dfgslib.format(date)) ; trace ("------- format from spark -----" ) ; trace ( dtf.format(date)) ; }

      ]]
      >
      </fx:Script>
      </s:Application>

      ------------

      Output :
      [SWF] C:\GaoMingzhu\Workspace\flex\TestStyle\bin-debug\Test1.swf - 1,255,510 bytes after decompression
      ------- format from gslib -----
      11:59 PM
      ------- format from spark -----
      12:00 AM

      I attached this sample code , please get it from attachment. And this is a regression because this case is pass with previous flex sdk version.

      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: