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

Calendar atuocomplete 1930

2 Answers 47 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jenni
Top achievements
Rank 1
Jenni asked on 24 May 2013, 02:39 PM
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

Alastair

2 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 29 May 2013, 10:19 AM
Hello,

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">
</telerik:RadDatePicker>

For RadDateInput the markup would be similar:

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

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.

Regards,
Victor Tachev
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 their blog feed now.
0
Jenni
Top achievements
Rank 1
answered on 29 May 2013, 12:23 PM
Perfect - thankyou
Tags
Calendar
Asked by
Jenni
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Jenni
Top achievements
Rank 1
Share this question
or