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

Recognition of 24hour format

5 Answers 146 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Matthew
Top achievements
Rank 1
Matthew asked on 13 Sep 2012, 07:57 PM
Hello, I have been using the RadDateTimePicker and I find it very useful and intuitive. I would just like to know how can I allow the DateTimePicker to recognize 24-hour formats in the input.

For example, when I enter 8 Sep 2012 0125, I am presented with the result of "8/9/2012 12:05 PM". What I am expecting, however, is the result of "8/9/2012 01:25 AM". Is there any way I can configure the DateTimePicker to allow it to automatically recognize the 24-hour date format, or is there any workaround for this?

Many thanks!

5 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 17 Sep 2012, 12:55 PM
Hello Matthew,

The time format in RadDateTimePicker control depends on the current culture. You can change it to a culture that uses 24 h time format (for example en-US) by setting the Culture property of the control.

The next code snippet shows the described approach:
<telerik:RadDateTimePicker Culture="en-US"/>

Hope this helps.

Greetings,
Vladi
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Matthew
Top achievements
Rank 1
answered on 26 Sep 2012, 05:18 PM
Hello, I've tried your solution and it seems that it still registers 0125 as 12:05 PM, which is not the intended input.
Do you know any other workaround for this?

Thanks!
0
Vladi
Telerik team
answered on 27 Sep 2012, 08:34 AM
Hello Matthew,

We apologize for misleading you, changing the Culture of the control will only change the way the time format is displayed but not the DateTime parsing method.

Achieving this behavior is not a build-in feature in the control but could be achieved easily by writing a custom parsing method in the ParseDateTimeValue event.

If you have any other questions feel free to write to us again.

Kind regards,
Vladi
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Matthew
Top achievements
Rank 1
answered on 02 Oct 2012, 05:52 PM
Hello.

Thank you for your kind response. I would just like to enquire, is it possible to apply this behaviour across an entire Silverlight app? (without needing to apply themes and properties on every Silverlight page, or replacing the RadDateTimePicker with a customized user control). This would make my work a lot more convenient.

Thank you very much!
0
Vladi
Telerik team
answered on 03 Oct 2012, 05:46 AM
Hello Matthew,

To use a customized DateTimePicker in your entire project I would suggest you to create a UserControl that inherits RadDateTimePicker and replace the telerik:RadDateTimePicker controls with your custom control.

All the best,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DateTimePicker
Asked by
Matthew
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Matthew
Top achievements
Rank 1
Share this question
or