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

RadDatePicker problem converting partial dates

2 Answers 48 Views
Input
This is a migrated thread and some comments may be shown as answers.
Gavin
Top achievements
Rank 1
Gavin asked on 16 Feb 2009, 04:16 AM

Hi,

I am having a problem with the conversion of partial dates in the RadDatePicker when the culture is set to Australia.  The issue is that if a user enters a date of 6/2008 the control converts it to 6/2/2008 instead of 1/6/2008.

While this makes sense for a US date format of MM/dd/yyyy it is incorrect for an AU date format of dd/MM/yyyy.

Is there any way I can make the date picker convert the date correctly?

thanks

Gavin.

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 16 Feb 2009, 11:56 AM
Hello Gavin,

Please try the following approach:
<script type="text/javascript" language="javascript"
    function ValueChanging(sender, args) 
    { 
        if (args.get_newValue().split('/').length == 2) 
            args.set_newValue("01/" + args.get_newValue()); 
    } 
</script> 

<telerik:RadDatePicker ID="RadDatePicker1" runat="server"
    <DateInput runat="server" ClientEvents-OnValueChanging="ValueChanging" /> 
</telerik:RadDatePicker> 

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Gavin
Top achievements
Rank 1
answered on 23 Feb 2009, 02:38 AM

Thanks Daniel,

This is what I expected I would have to do.  Suppose I was hoping for a setting I missed.

cheers

Gavin.

Tags
Input
Asked by
Gavin
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Gavin
Top achievements
Rank 1
Share this question
or