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

Stop auto-correcting date

7 Answers 69 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 1
Jack asked on 21 Oct 2015, 12:10 PM
When a user enters a date of 1a/2/2​015, the raddatepicker auto​-corrects it to 1/2/2015. If a user enters a date of 13/01/2015 the raddatepicker auto-corrects it to 01/13/2015. I don't want the control to assume what the user meant to type. I would like to turn this feature off so that I can throw a validation error. Is this possible?

7 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 26 Oct 2015, 11:11 AM
Hi Jack,

You can try setting the following property to achieve this requirement:
<telerik:RadDatePicker ID="RadDatePicker1" runat="server">
    <DateInput runat="server" EnableSmartParsing="false">
    </DateInput>
</telerik:RadDatePicker>

Hope this helps.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jack
Top achievements
Rank 1
answered on 04 Jan 2016, 06:13 PM

Hi Eyup,

Sorry it's been so long, I was on another project.

This did not solve my issue. Below is the source for one of the datepicker controls:

<telerik:RadDatePicker ID="rdpBegin" Runat="server" Culture="en-US" ResolvedRenderMode="Classic">
    <Calendar EnableWeekends="True" FastNavigationNextText="&lt;&lt;"
        UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False">
        <ClientEvents OnDateSelected="dateSelected" />
    </Calendar>
    <DateInput ID="DateInput1" runat="server" EnableSmartParsing="false">
        <ClientEvents OnError="HandleError" />
        <EmptyMessageStyle Resize="None" />
        <ReadOnlyStyle Resize="None" />
        <FocusedStyle Resize="None" />
        <DisabledStyle Resize="None" />
        <InvalidStyle Resize="None" />
        <HoveredStyle Resize="None" />
        <EnabledStyle Resize="None" />
    </DateInput>
    <DatePopupButton HoverImageUrl="" ImageUrl="" />
</telerik:RadDatePicker>

0
Maria Ilieva
Telerik team
answered on 07 Jan 2016, 09:21 AM
Hello Jack,

I have tested the provided code in a sample application on my end and it works correctly without modifying the entered date as per your requirements. Please make sure that you are using the latest version of the controls where the mentioned property is implemented.

Regards,
Maria Ilieva
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Martin Horst
Top achievements
Rank 1
answered on 02 Mar 2016, 08:43 AM

Hi.

i've got the same problem. I tried the EnableSmartParsing="false" option but after setting the smart parsing to false i can't input any date, even valid ones. I added my html code below how i configured the datepicker.

 

Best regards

Martin Horst

 

          <telerik:RadDatePicker ID="datePickerGeburtsDatum" runat="server" RenderMode="Classic" MinDate="01.01.0001">
            <DateInput runat="server" DateFormat="dd.MM.yyyy" DisplayDateFormat="dd.MM.yyyy" EnableSmartParsing="false"></DateInput>
            <DatePopupButton ImageUrl="/web/images/icons/datepicker_normal.png" HoverImageUrl="/web/images/icons/datepicker_hover.png"/>            
          </telerik:RadDatePicker>

0
Maria Ilieva
Telerik team
answered on 07 Mar 2016, 10:41 AM
Hello,

I tried to replicate the issue you described on my end but to no avail, Re "EnableSmartParsing" property is working properly in my test application. See the test pages attached and verify what the difference in your case is.

Regards,
Maria Ilieva
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Martin Horst
Top achievements
Rank 1
answered on 09 Mar 2016, 03:13 PM

Hello,

today I installed the latest version (Q1 2016) but I still got the same issue. Every date I enter or select is marked as invalid. 

Regards

Martin Horst

0
Maria Ilieva
Telerik team
answered on 11 Mar 2016, 03:20 PM
Hello,

I tested the described scenario and it works properly on my end. Find attached my test project and verify what the difference in your case is.

Regards,
Maria Ilieva
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
DatePicker
Asked by
Jack
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Jack
Top achievements
Rank 1
Maria Ilieva
Telerik team
Martin Horst
Top achievements
Rank 1
Share this question
or