Search code examples
javascriptjquerydatetimemaskjquery-inputmask

jQuery inputmask datetime not work


I'm trying to apply the datetime mask on an input but this didn't work the jQuery plugin I used is inputmask I did my code on codepen site and include all needed js libraries but don't have any idea why this not work

<input id="datetime" />

$('#datetime').inputmask({
    mask: "2/1/y h:s t\\m",
    placeholder: "mm/dd/yyyy hh:mm xm",
    alias: "datetime",
    hourFormat: "12"
}); 

Solution

  • I'm not familiar with Inputmask, but fiddling around with your Pen... this seems to work for me:

    <input id="datetime" />
    
    $('#datetime').inputmask({                
        placeholder: "mm/dd/yyyy hh:mm xm",
        alias: "mm/dd/yyyy hh:mm xm",
        hourFormat: "12"
    });