javascript - Twitter Bootstrap inputmask filter for time -


so have been using twitter bootstrap project, , need field capture time in 24hr format. masks provided default basic , don't allow regex (as far know), digging in bootstrap-inputmask.js code, found this:

$.fn.inputmask.defaults = { mask: "", placeholder: "_", definitions: {   '9': "[0-9]",   'a': "[a-za-z]",   '?': "[a-za-z0-9]",   '*': "."       } } 

so added 2 new lines:

'h': "[01][0-9]|2[0-3]", 's': "[0-5][0-9]" 

this how define html input:

<input type="text" id="eventhour" data-mask="h:s"/>    

when render page, text field displays indeed : placeholder, doesn't allow character @ (no number, no alphabetic). can out there hint me @ doing wrong? need add more code anywhere on script?

thanks!


Comments