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

RadDatePicker not picking up dates post year 2030

2 Answers 240 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Vaibhav
Top achievements
Rank 1
Vaibhav asked on 22 Jul 2013, 11:01 AM
Hi,

I am using RadDatePicker control for start and end date input controls on my form. I am taking "01/01/1980" as min date and "12/31/2049" as max date. I am facing a problem when I enter the date manually in Date text box. 

Scenario 1: I enter date as 123129. RadPicker correctly picks it up as 12/31/2029 and displays the formatted date value.
Scenario 2: I enter date as 123130. I get a client side validation warning. No matter what day and month I enter, it freezes every time on year greater than XX/XX/29 (2029). 
Scenario 3: I enter date as 12312030 - complete year instead of just last 2 digits. RadPicker correctly picks it up as 12/31/2030 and displays the formatted date value.

I tested all 3 scenarios on your ASP.NET Calendar Demo - DatePicker - First Look as well. 

I am not sure why the validation kicks in when the max date is set as 12/31/2049. Please assist me in resolving this issue.

Thanks,
Vaibhav

2 Answers, 1 is accepted

Sort by
0
Accepted
Angel Petrov
Telerik team
answered on 25 Jul 2013, 08:30 AM
Hi Vaibhav,

I have already replied in the official support ticket which you have opened regarding this matter. In order to help other community members overcome the issue I am posting my reply here as well:

"The problem experienced is caused by the fact that years starting from 30 and greater are parsed as 19XX. This means that 123129 will be parsed as 12/31/2029 and 123130 will be parsed as 12/31/1930. Now this is an invalid date because the default value of the MinDate property is 1/1/1980. That said I suggest that you set the ShortYearCenturyEnd property of the DateInput to 2099 in order to resolve the problem.
<telerik:RadDatePicker runat="server" ID="Picker1" MinDate="" DateInput-ShortYearCenturyEnd="2099"></telerik:RadDatePicker>
"
Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Vaibhav
Top achievements
Rank 1
answered on 26 Jul 2013, 06:23 AM
Thanks a lot Angel, my issue is resolved now.

In case anybody is interested in further reading, here are 2 posts I found useful as I researched more on this topic:

Thanks,
Vaibhav
Tags
Calendar
Asked by
Vaibhav
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Vaibhav
Top achievements
Rank 1
Share this question
or