How to add hyphens(-) in date field?

How to add hyphens(-) in date field?


Hello Team,

My requirement is that when user enters date in text box in YYYY-MM-DD format, I want to add hyphens(-) automatically in date value.

e.g. user enters 2017, what I want is that hyphen should be added immediately and it will look like 2017-

then user enters month as 05 and it should look like 2017-05-

How to achieve this?

Thanks and Regards,

Suraj Borade

Hello Suraj,

Best option would be use some mask, like this component.


Eduardo Jauch

P.S. Other than this, only applying it yourself with JavaScript.


Maybe CustomMasks component could help?

Kind regards,


Hi Suraj,

you can use custom masking using jquery function as defined here.