Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Adobe Flex SDK Previous
-
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.