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

RadDatePicker autocorrect

7 Answers 151 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Kazimierz Szadkowski
Top achievements
Rank 1
Kazimierz Szadkowski asked on 22 Mar 2010, 08:34 AM
I have a problem with autocorrect functionality of RadDatePicker control. When I manually type invalid date '29-02-2010' (no such date this year) it is automatically changed to '28-02-2010', without any notice. It might be confusing for users, so I would rather like to display validation message and let users correct themselves. However, I cannot find a way to turn autocorrection off. I would be most grateful for any tips.

7 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 23 Mar 2010, 11:10 AM
Hello,

Add the following client side code in order to override the built-in date parser engine.

JavaScript:
 
<script type="text/javascript">    
    Telerik.Web.UI.RadDateInput.prototype.parseDate = function(value, baseDate)    
    {    
        if (new Date(value) != "NaN")    
            return value;    
    }    
</script>   

Hope this helps,
Princy.
0
Kazimierz Szadkowski
Top achievements
Rank 1
answered on 23 Mar 2010, 02:59 PM
Works like a charm. Thanks!
0
Kazimierz Szadkowski
Top achievements
Rank 1
answered on 30 Mar 2010, 08:03 AM
Unfortunatelly something goes wrong with this solution - when I use the function you suggested some client events of DatePicker and its DateInput are blocked. For example, 'ValueChanging" of DateInput is executed, but "ValueChanged" not. "DateSelected" od DatePicker doesn't work either. How can I deal with this?
0
Chris Lynch
Top achievements
Rank 1
answered on 30 Mar 2010, 02:18 PM
Unfortunately, the date picker control is awful.

My suggestion is that you abandon Telerik and implement one of these options:

http://www.codedigest.com/Articles/ASPNET/247_DatePicker_Control_in_ASPNet.aspx

I suggest the jquery route.

0
Dimo
Telerik team
answered on 31 Mar 2010, 07:23 AM
Hello all,

Another discussion on the same topic goes at the following forum thread, where a more in-depth description of the situation is provided:

http://www.telerik.com/community/forums/aspnet-ajax/calendar/raddatepicker-autocorrect-override-othe-forum-posts-not-working.aspx

Regards,
Dimo
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Joe
Top achievements
Rank 1
answered on 06 Oct 2014, 05:06 PM
I have almost the complete opposite of the above problem with the radDatePicker date input. When tabbing away from a GridDateTimeColumn where the column has the following properties:

<telerik:GridDateTimeColumn HeaderText="Sign Date"
UniqueName="SignatureDate"  
DataFormatString="{0:MM/dd/yyyy}"
EditDataFormatString="MM/dd/yyyy"
MaxLength="10">
<HeaderStyle Width="120px" />
</telerik:GridDateTimeColumn>

The autocorrect function that I'm assuming is embedded in the Telerik DLL isn't consistently firing. On the Radgrid right above it though, it works correctly. Any idea as to how I can ensure that this fires every time I move away from the GridDateTimeColumn?

Thanks,

- Joe
0
Viktor Tachev
Telerik team
answered on 09 Oct 2014, 09:28 AM
Hello Joe,

I have replied to your query in the other thread you have posted here. I suggest we continue the conversation there.

On a side note, please have in mind that it is recommended to avoid submitting duplicate threads. This will allow us to keep better track of your support history an provide better answers quicker.

Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Calendar
Asked by
Kazimierz Szadkowski
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kazimierz Szadkowski
Top achievements
Rank 1
Chris Lynch
Top achievements
Rank 1
Dimo
Telerik team
Joe
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or