jaridmargolin / formatter.js

Format html inputs to match a specified pattern
http://firstopinion.github.io/formatter.js
2.48k stars 235 forks source link

Format time field (HH:MM) #53

Closed deaser closed 10 years ago

deaser commented 10 years ago

How can I mask input to accept only 24-hour format? I've tried something like: new Formatter(timeElems[i], { 'pattern': '{{99}}:{{99}}', 'persistent': false, 'patterns':[ { '^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$': 'time: {{*****}}' } ] });

but it doesn't work at all.

jaridmargolin commented 10 years ago

This question would be more suited for a platform such as stackoverflow. I would like to keep issues primarily for bug fixes / feature requests.

Best of luck.