Jquery inputmask "dd-mm-yyyy hh:mm"
15,439
Solution 1
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/
Solution 2
Finally Got the answer, Link i got the answer is https://github.com/RobinHerbots/Inputmask/issues/727
(function($){
$('input').inputmask("datetime",{
mask: "1-2-y h:s",
placeholder: "dd-mm-yyyy hh:mm",
leapday: "-02-29",
separator: "-",
alias: "dd/mm/yyyy"
});
})(jQuery)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://rawgit.com/RobinHerbots/jquery.inputmask/3.x/dist/jquery.inputmask.bundle.js"></script>
<input type="text">
Author by
Sodiaan
Updated on June 25, 2022Comments
-
Sodiaan almost 2 years
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".
-
Ganesh Putta over 6 yearsAdd some code to fiddle with plugin
-
Pedram over 6 years@MasterYoda
inputmask
is the plugin name. -
Kaarthik over 6 yearsplaceholder: "dd-mm-yyyy hh:mm xm" try replacing it with this
-
Sodiaan over 6 years@GeekBoy it's not working
-
Ganesh Putta over 6 yearsCheck my answer, I found somewhere on the web
-
-
Sodiaan over 6 yearsBTW, why "-02-29" ? Maybe "29-02-" ?