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

FallbackDateTimeFormatter - error thrown when format a date which only contain time

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

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

    Description

      Steps to reproduce:
      1.create a date which only has time: var date7:Date = new Date('2:57 PM');

      2.create a DateTimeFormatter instance with dateStyle 'long' and timeStyle 'long':
      <s:DateTimeFormatter id="dtFormatterLL" dateStyle="long" timeStyle="long"/>

      3.format the date defined in step 1: dtFormatterLL.format(date7)

      Actual Results:
      It throw ReferenceError: Error #1069: Property NaN not found on _AS3_.vec.Vector.<String> and there is no default value.

      Expected Results:
      The return value from DateTimeFormatter is empty string.

      Investigation Result:
      according to FallbackDateTimeFormatter source code line 153 and 155: WEEKDAYLABELS[dateTime.getDay()],the return value of dateTime.getDay()will be the index of WEEKDAYLABELS. When we format a date like, "2:57 PM", method getDay()return 'NaN' which is a invalid index, so error thrown.

      Notes:
      Issue happens at FallbackDateTimeFormatter source code line 153 and 155.
      You can find sample code in attachment.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment