We need to customize the way TimePicker is working.
If we enter "5" into a time field it assumes 5 a.m.. This needs to be smarter. When a user enters the following, default to:
a. 7-11 assumes AM
b. 12 assumes PM
c. 1-6 assumes PM
d. If the user types an 'a' or 'p' after a number it will set the time appropriately. For example 1a returns 1:00AM, 8p returns 8:00PM.
Please help me on this.
Thanks in advance.
5 Answers, 1 is accepted
Thank you very much for your reply with the solution.
But sorry to say you that this doesnt satisfy our requirement.
We need the format of 00:00 not 00:00:00
Even when we tried to put any number int he text box it didnt even fire any event of the IValueConverter interface implemented class.
Could you please give us a solution satisfying any of our need??
e.g. (a. 7-11 assumes AM)
To accomplish this task (00:00:00 to 00:00) you can add this code in the Convert method of the IValueConverter implementation class:
I have same requirement and everyting is working good using RadTimePicker control. But I when user enter 1 into Time Textbox that time it displaydate 1:00 AM. Insted of that I want 1:00 PM by default,
I want 1:00 PM when user enter 1 insted of 1:00 AM......upto........6 only
I try to do this but it is not working
void radTimePicker_ParseDateTimeValue(object sender, ParseDateTimeEventArgs args)
string input = args.TextToParse.ToLower();
DateTimeFormatInfo formatInfo = new System.Globalization.DateTimeFormatInfo();
bool isNum = double.TryParse(input, out Num);
if (Num >= 1 && Num <= 6)
new TimeSpan(12 + Convert.ToInt32(input)));
//radTimePicker.DisplayDate.AddHours(12 + Convert.ToInt32(input)));
//args.Result.Value.AddHours(12 + Convert.ToInt32(input));
Please reply me..........