Recognition of 24hour format

6 posts, 0 answers
  1. Matthew
    Matthew avatar
    4 posts
    Member since:
    Aug 2012

    Posted 13 Sep 2012 Link to this post

    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!
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 17 Sep 2012 Link to this post

    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.

  3. DevCraft banner
  4. Matthew
    Matthew avatar
    4 posts
    Member since:
    Aug 2012

    Posted 26 Sep 2012 Link to this post

    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!
  5. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 27 Sep 2012 Link to this post

    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.

  6. Matthew
    Matthew avatar
    4 posts
    Member since:
    Aug 2012

    Posted 02 Oct 2012 Link to this post

    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!
  7. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 03 Oct 2012 Link to this post

    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.

Back to Top
DevCraft banner