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

RadDateInput or TimePicker keyboard AM/PM entry

3 Answers 36 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
David Cowan
Top achievements
Rank 1
David Cowan asked on 08 Jun 2012, 04:02 PM
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

3 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 12 Jun 2012, 10:06 AM
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.
0
David Cowan
Top achievements
Rank 1
answered on 14 Jun 2012, 01:40 PM
Is there a way to extend the control to make this work?
0
Accepted
Vasil
Telerik team
answered on 15 Jun 2012, 11:25 AM
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.
Tags
Calendar
Asked by
David Cowan
Top achievements
Rank 1
Answers by
Vasil
Telerik team
David Cowan
Top achievements
Rank 1
Share this question
or