Jquery inputmask "dd-mm-yyyy hh:mm"

Sodiaan picture Sodiaan · Nov 29, 2017 · Viewed 12.8k times · Source

How to configure to achieve "dd-mm-yyyy hh:mm" format?

$('input').inputmask({
                mask: "1-2-y h:s",
                placeholder: "dd-mm-yyyy hh:mm",
                leapday: "29-02-",
                separator: "-",
                alias: "dd-mm-yyyy"
            });

This not work, it shows "dd-mm-yyyy h:s" and I can edit only "dd-mm-yyyy".

inputmask

https://jsfiddle.net/re4qxxr1/

Answer

Abdul Rafay picture Abdul Rafay · Nov 29, 2017

try this will help you:

$('input').inputmask("datetime",{
     mask: "1-2-y h:s", 
     placeholder: "dd-mm-yyyy hh:mm", 
     leapday: "-02-29", 
     separator: "-", 
     alias: "dd-mm-yyyy"
});

Fiddle: https://jsfiddle.net/53nomjyb/193/