My customers are use to always using military time. The RadDateTimePicker handles PM values like 1405 (2:05 PM), however, if a user enters something like 5/10/2011 0105, it will convert it to 10:05 am instead of 1:05 am. Is there a way to fix this?
I found a temporary solution, but it is not very clean. I added the ParseDateTimeValue event to my controls...
I found a temporary solution, but it is not very clean. I added the ParseDateTimeValue event to my controls...
private
void
RadDateTimePicker_ParseDateTimeValue(
object
sender, Telerik.Windows.Controls.ParseDateTimeEventArgs args)
{
if
(args.IsParsingSuccessful)
{
string
textToParce = args.TextToParse.Trim();
DateTime parced;
while
(textToParce.Contains(
" 0"
))
{
textToParce = textToParce.Replace(
" 0"
,
" "
);
}
for
(
int
i = 1; i < 10;i++ )
{
if
(textToParce.Contains(
" "
+ i))
{
textToParce = textToParce.Replace(
" "
+ i,
" "
+ i +
":"
);
i = 10;
}
}
if
(DateTime.TryParse(textToParce,
out
parced))
{
args.Result = parced;
}
}
}