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

DateTimePicker Format Error

2 Answers 63 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Erwin
Top achievements
Rank 1
Erwin asked on 02 Dec 2009, 08:55 AM

Senario:

i have a Raddatetimepicker that has a format "dd/MM/yyyy HH:mm" in serverside pageload then assign the present date to it. Example December  2 ,2009  7:30 am  the display is   "02/12/2009 07:30". Every 15 seconds it would update its time. I have a java script that triggers ClientEvents-OnLoad = OnDtpLoad

 

 

 

the javascript would look like this:

function OnDtpLoad(){

 

    var

 

 dtpTime = $find("<%=RadDateTimePicker.ClientID%>");

 

 

    var updateDate = new Date();   

 

    dtpTime.set_selectedDate(updateDate );

 

    var

 

t = setTimeout(OnDtpLoad()', 15000);

}
this function would trigger ever 15 seconds to update the datepicker.

Problem:
    
if you look at it,  you would expect that the datepicker display would be "02/12/2009 07:30"  but instead it display this "12/02/2009 07:30". with a value of Febuary 12, 2009 7:30 am..

Why is this so???  I have tried formating the date in javascript but it will return Febuary.
if you would do this:
    dtpTime.set_selectedDate(dtpTime.get_selectedDate());
    the display would be first December next update would be Febuary then December then Febuary and so on..
.........
I think is because of the Format dd/mm/yyyy since in the format mm/dd/yyyy the display is OK.....

Please help...
    I'm using Q1 2009 and  I'm in a country where the format is mm/dd/yyyy but i need the format dd/mm/yyyy
 

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 02 Dec 2009, 10:47 AM
Hello Erwin,

I guess the problem happens for old version of Telerik control. I tried the same scenario in my end (RadControls version 2009, 3, 1103, 35) and it is working fine for me. Can you try upgrading to latest control and check if this helps?
Updating RadControls for ASP.NET to another version or license

-Shinu.
0
Dimo
Telerik team
answered on 02 Dec 2009, 11:22 AM
Hello,

That is correct, the issue is resolved in later releases (Q2 2009). The problem is that the order of days and month in the DateFormat is different from the order of the default DateFormat for the given culture. In Q1 2009 such scenario was not supported.

Best wishes,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Calendar
Asked by
Erwin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Dimo
Telerik team
Share this question
or