1. #1
    Ext User
    Join Date
    Oct 2009
    Posts
    3
    Vote Rating
    0
    chkuek is on a distinguished road

      0  

    Default [CLOSED][2.2.1] parseDate("9999-99-99")

    [CLOSED][2.2.1] parseDate("9999-99-99")


    Hi, I did following codes:

    Date.parseDate("9999-99-99", "Y-m-d")

    and output is : Thu Jun 07 10007 00:00:00 GMT+0800 (Malay Peninsula Standard Time)

    I'm not sure is it designed in this way, but I actually expect it returns me error message which indicates that this date is invalid.

    Can someone confirmed to me whether it is a bug? If not, may I know the reasons for it to behave this way?

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    This is not a bug. The date roll-over is by design.

    In Ext 3 parseDate has a third parameter (strict) that you can set to true to return 'null' for invalid dates.

  3. #3
    Ext User
    Join Date
    Oct 2009
    Posts
    3
    Vote Rating
    0
    chkuek is on a distinguished road

      0  

    Default


    I see. Thank you very much for the replies.

  4. #4
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    the strict option is also available in 2.3.0.

  5. #5
    Ext User
    Join Date
    Oct 2009
    Posts
    3
    Vote Rating
    0
    chkuek is on a distinguished road

      0  

    Default


    Thanks mystix, but too bad we are using version 2.2.1.

Thread Participants: 2