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

Mask for 25 hours

3 Answers 140 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Maurizio
Top achievements
Rank 2
Maurizio asked on 10 Sep 2014, 01:35 PM
We want to use RadMaskedDateTimeInput to let the user enter TimeSpans fo more than 24 hours.
For example 25 hours should be displayed and entered as

25:00:00  or   01:01:00:00 (one day and one hour)

using a "HH:mm:ss" or "dd:HH:mm:ss" mask does not work! 

3 Answers, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 15 Sep 2014, 12:31 PM
Hi Peter,

RadDateTimeInput uses a DateTime type as value and not TimeSpan. So, if you need to use TimeSpan as a Value of the MaskedInputControl you should use:
- RadMaskedTextInpud with custom mask token which takes only digits - you can see how to write this in our help topic - Mask Tokens. In your case your valid characters would be only digits and the mask would be "$$:$$:$$" to have ":" symbols between the numbers;
- use a ViewModel and custom validation rule to restrict the user input per your requirement. More about validations you can find here

Please take a look at this topics and write us back if you need any further assistance. 

Regards,
Milena
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Maurizio
Top achievements
Rank 2
answered on 18 Sep 2014, 03:13 PM
Hi Milena,

I got it working with a RadMaskedTextInput and Mask = "##:##:##:##". 

But it's been a pain in the a... I had to write my own converter for String-TimeSpan conversion. Would be cool to have a Telerik control for TimeSpans as well.

Thanks for you answer.
0
Milena
Telerik team
answered on 19 Sep 2014, 02:33 PM
Hi Peter,

Thank you for the feedback.

Indeed, currently the required functionality is not supported in the RadMaskedInput suite. However, you can log a feature request in our Feedback portal. So, we can then further research on it and decide if it will be approved and implemented as a built-in feature. 
 
Regards,
Milena
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Maurizio
Top achievements
Rank 2
Answers by
Milena
Telerik team
Maurizio
Top achievements
Rank 2
Share this question
or