RadDatePicker not picking up dates post year 2030

3 posts, 1 answers
  1. Vaibhav
    Vaibhav avatar
    2 posts
    Member since:
    Jul 2012

    Posted 22 Jul 2013 Link to this post

    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. Answer
    Angel Petrov
    Admin
    Angel Petrov avatar
    1006 posts

    Posted 25 Jul 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vaibhav
    Vaibhav avatar
    2 posts
    Member since:
    Jul 2012

    Posted 26 Jul 2013 Link to this post

    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
Back to Top