Calendar atuocomplete 1930

3 posts, 0 answers
  1. Jenni
    Jenni avatar
    2 posts
    Member since:
    May 2013

    Posted 24 May 2013 Link to this post

    when I enter 1/1/29 it autocompletes to 1/1/2029 but if I do 1/1/30 I get 1/1/1930
    I am using v 2013.1.417.35 - the latest as of 24-May-2013

    How can I make it go to 1/1/2030

  2. Viktor Tachev
    Viktor Tachev avatar
    1784 posts

    Posted 29 May 2013 Link to this post


    If I understand correctly you are entering the date values in an input field. So you are probably using RadDatePicker or RadDateInput control. Both of them allow you to manage the way dates are parsed when a short year value is entered as input.

    You could use the ShortYearCenturyEnd property to set the largest value that would be parsed as year from the current century when short year value is entered. The property could be set in the markup or in the code-behind. By default the value for this property is 2029.

    If you are using RadDatePicker the setting of the property in the markup could be done like shown below:

    <telerik:RadDatePicker ID="RadDatePicker1" runat="server" DateInput-ShortYearCenturyEnd="2080">

    For RadDateInput the markup would be similar:

    <telerik:RadDateInput ID="RadDateInput1" runat="server" ShortYearCenturyEnd="2080">

    When using the settings shown you would get 1/1/2079 if you enter 1/1/79. However, when you enter 1/1/81 as an input you would get 1/1/1981 as a result.

    Additionally you could set a range for the input of the controls with the MinDate and MaxDate properties. If the entered value is less than MinDate of greater than MaxDate the input control signals the user with error icon and does not accept the value. The default value for MinDate is 1/1/1980 and for MaxDate it is 12/31/2099.

    I hope this information would help you achieve the result you are looking for.

    Victor Tachev
    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 their blog feed now.
  3. Jenni
    Jenni avatar
    2 posts
    Member since:
    May 2013

    Posted 29 May 2013 Link to this post

    Perfect - thankyou
Back to Top