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

Input Mask

6 Answers 1212 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
taylor
Top achievements
Rank 1
taylor asked on 30 Oct 2014, 09:40 PM
Is there anyway to set an input mask on the Kendo date picker?

6 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 31 Oct 2014, 08:31 AM
Hello taylor,

In general, the DatePicker widget allows different input formats, hence it does not restrict user input and the best way to validate the value is using a client validation framework. Here is a demo that demonstrates how to accomplish this.

If the mask is a must, then you can try to combine Kendo UI MaskedTextBox and Kendo UI DatePicker, but note that they are not intended and designed to work together and there could be undesired behaviors. Here is a demo that shows a proof-of-concept implementation (use on your own responsibility).

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
taylor
Top achievements
Rank 1
answered on 07 Nov 2014, 10:01 PM
Thanks for the advice. We will not be using an input mask. Adding parse formats is what I really needed to do.
0
Ruben
Top achievements
Rank 1
answered on 30 Aug 2016, 01:50 PM

On 2016 is this still true?

[quote]

If the mask is a must, then you can try to combine Kendo UI MaskedTextBox and Kendo UI DatePicker, but note that they are not intended and designed to work together and there could be undesired behaviors

[/quote]

0
Georgi Krustev
Telerik team
answered on 01 Sep 2016, 07:40 AM
Hello,

Combining them is still not officially supported. Nevertheless, you can check our how-to demo for details about the implementation:

http://docs.telerik.com/kendo-ui/controls/editors/datepicker/how-to/date-masking-using-maskedtextbox

Regards,
Georgi Krustev
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Marie-Claude
Top achievements
Rank 1
answered on 30 Jul 2019, 07:35 PM

Hello, 

I'm using this demo to put a mask on my date.

But with the datePicker control, when there is an invalid, it clears th text.

With the mask, there  is no validation. Is there a simple way to mimic the datepicker behaviour?

And in 2019, is there a better way to do this?

 

0
Alex Hajigeorgieva
Telerik team
answered on 01 Aug 2019, 12:38 PM
Hi, Marie-Claude,

I am pleased to let you know that indeed, there is - the functionality is now built-in and can be enabled by adding a dateInput:true to the configuration:

https://docs.telerik.com/kendo-ui/api/javascript/ui/datepicker/configuration/dateinput

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Date/Time Pickers
Asked by
taylor
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
taylor
Top achievements
Rank 1
Ruben
Top achievements
Rank 1
Marie-Claude
Top achievements
Rank 1
Alex Hajigeorgieva
Telerik team
Share this question
or