You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Justin Mclean (JIRA)" <ji...@apache.org> on 2013/04/18 03:13:15 UTC

[jira] [Resolved] (FLEX-24691) ObjectUtil.dateCompare does not handle an invalid date object

     [ https://issues.apache.org/jira/browse/FLEX-24691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Mclean resolved FLEX-24691.
----------------------------------

       Resolution: Fixed
    Fix Version/s: Apache Flex 4.10.0

Fixed and checked into develop branch. Note that this effects list and data grid sorting (both spark and mx). 

Mustella collection sorting tests pass. (655 tests pass)
                
> ObjectUtil.dateCompare does not handle an invalid date object
> -------------------------------------------------------------
>
>                 Key: FLEX-24691
>                 URL: https://issues.apache.org/jira/browse/FLEX-24691
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: .Unspecified - Framework
>    Affects Versions: Adobe Flex SDK 4.1 (Release)
>         Environment: Affected OS(s): Mac
> Affected OS(s): Mac OS 10.6
> Browser: Firefox 3.x
> Language Found: English
>            Reporter: Adobe JIRA
>            Assignee: Justin Mclean
>              Labels: easyfix, easytest
>             Fix For: Apache Flex 4.10.0
>
>
> Steps to reproduce:
> 1. Create an invalid Date object: var a:Date = new Date(Date.parse(""))
> 2. Create a valid Date Object: var b:Date = new Date()
> 3. Compare these dates: ObjectUtil.dateCompare(a,b);
>  
>  Actual Results:
> The comparison returns 0. This is because dateCompare uses Date.getTime() to compare values, and a.getTime() returns NaN which is neither less than nor greater than a valid number. However, it is also not equal, which is the assumption in dateCompare().
>  
>  Expected Results:
> either 1 or -1
>  
>  Workaround (if any):
>  Be careful in your code to not pass such a Date into ObjectUtil.dateCompare().

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira