This is a migrated thread and some comments may be shown as answers.

UnExpected date in datepicker

1 Answer 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
moti farhadian
Top achievements
Rank 1
moti farhadian asked on 08 Apr 2014, 03:50 PM
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

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 09 Apr 2014, 08:21 AM
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.

 
Tags
General Discussions
Asked by
moti farhadian
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or