Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Input Masks for datetime input using American dates

I'm using Robin Herbot's excellent jQuery Input Masks plugin. [ https://github.com/RobinHerbots/jquery.inputmask ]. It's quite complete and seems to have everything I need, but I can't seem to figure one thing out.

How do I create a mask like: "mm/dd/yyyy hh:mm pm" where both the date portion and the time portion work like the "date" and "time" masks work?

I can use date or time, but datetime uses the European dd/mm format rather than the mm/dd format I need. I've tried several permutations, but I'm clearly missing something and the documentation takes a lot for granted.

like image 611
pbarney Avatar asked Feb 14 '23 23:02

pbarney


1 Answers

jQuery Input Mask

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

Check other aliases.

like image 153
Bob Avatar answered Mar 24 '23 10:03

Bob