UnExpected date in datepicker

2 posts, 0 answers
  1. moti farhadian
    moti farhadian avatar
    3 posts
    Member since:
    Oct 2012

    Posted 08 Apr 2014 Link to this post

    Hi,
    I have DatePicker in my app.
    When i fill the control with value "00.00.00" the control change automativ the value to "12/31/1998"
    Telerik Demo

    Best regards
    moti
  2. Vasil
    Admin
    Vasil avatar
    1640 posts

    Posted 09 Apr 2014 Link to this post

    Hi Moti,

    The the valid months are from 1 to 12, and the dates are from 1 to 31. The 0 is invalid date and month.
    The 0 year is 2000 (determinated by the ShortYearCenturyEnd property) The default is 2029. This means that 30 - 99 year will be considered as 1930 - 1999. And years from 0 to 29 as 2000 to 2029

    The picker relay on Date JavaScript objects. 0 month is considered as 12 month the previous year. And 0 day is considered as last day of the previous month. Note that zeros can be different in the different browsers and their Date implementation.
    So the expected input like 1/1/0 will be parsed as 01/01/2000. And parsing 0/0/0 will vary in browsers.

    If it is possible, could you share with us why you are trying to set "00.00.00" as value in the DateInput and what would be your expectations? As string this looks more like time rather than date.

    Regards,
    Vasil
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top