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

set_selectedDate() displays wrong date format

2 Answers 182 Views
Input
This is a migrated thread and some comments may be shown as answers.
Roland Klug
Top achievements
Rank 1
Roland Klug asked on 23 Mar 2012, 02:00 PM
Hi Telerik team,

I'm facing a problem with the raddatepicker, raddatetimepicker and radtimepicker controls in your recent release 2012.1.215.35. With release 2011.3.1305.35 there was no such problem.

Please take a look at this page: http://www.sabiotec.de/Telerik/datepicker.aspx. I hope this page helps to clearify the issue.

I implemented a custom date picker control which inherits from your raddatepicker. The intention is to provide a set of keyboard shortcuts in order to easily change the selecte date. I.e., when the user focuses the date picker control and presses the "v" key, the previous day is set, pressing the "n" key sets the next day, pressing "h" sets the current day and so forth. I use javascript code to determine the appropriate date value and set it using the set_selectedDate() method.

This works fine. The problem is that after setting the date value, it is displayed in the wrong format, and I don't konw how to change this format (I tried "DateFormat", "DisplayDateFormat", "Culture", but to no avail).

For instance, without being focused the date is displayed correctly in German format, like "23.03.2012". After focusing the picker control and pressing the "v" key (which sets the previous day), the date is displayed like "2012-03-22-00-00-00". When the picker control looses the focus, the date is displayed correctly again like "22.03.2012".

The problem becomes more severe for the radtimepicker control, which indicates an error after setting the date value (because on invalid data input).

Thank your for your assistance!
Roland

2 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 26 Mar 2012, 11:38 AM
Hello Roland,

Thank you for the provided sample. I see the problem. It happens because of the new rendering of RadInput. We will try to improve the new rendering in order to work properly for such cases. Until then you could set EnableSingleInputRendering="false" to the DateInput's of your pickers.

Kind regards,
Vasil
the Telerik team
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
Roland Klug
Top achievements
Rank 1
answered on 27 Mar 2012, 08:26 AM
Thank you! That resolved the issue for the moment.
Tags
Input
Asked by
Roland Klug
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Roland Klug
Top achievements
Rank 1
Share this question
or