RadDateInput or TimePicker keyboard AM/PM entry

4 posts, 1 answers
  1. David Cowan
    David Cowan avatar
    22 posts
    Member since:
    Nov 2009

    Posted 08 Jun 2012 Link to this post

    Entering times into the control such as
    5a
    510a
    510am
    5:10am
    6pm
    610pm
    6:10pm
    13:20
    13

    all work and get populated as the correct time.  However

    6p
    610p
    6:10p

    do not.  Is there any way to make this work or any reason it wasn't supported.  If 'a' works I would expect 'p' to also work
  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 12 Jun 2012 Link to this post

    Hello David,

    "5a" works as "5am" not because "a" is considered as "am" , but because by default the "5:00" is "5 AM".
    The same way "5z" will be considered as 5 AM, and "5sometext" will be considered as "5 AM"
    To get PM you have to provide correct text that to be parsed in PM, otherwise the parsing will consider it as 5:00 which is AM.

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David Cowan
    David Cowan avatar
    22 posts
    Member since:
    Nov 2009

    Posted 14 Jun 2012 Link to this post

    Is there a way to extend the control to make this work?
  5. Answer
    Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 15 Jun 2012 Link to this post

    Hello David,

    You can handle the onValueChanging event, parse the date yourself and use the set_newValue() to set the value in correct format. Simplest solution will be to check if the last char is "p" and to add 'm' in this case. You are free to write more complex logic in order to parse more specific strings as well.

    Greetings,
    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.
Back to Top