JQueryUI DatePicker: Add hour/minute/second, jqueryuidatepicker
The datepicker of jquery. ui is the jquery plug-in of year, month, and day by default. If you want to add the time, minute, and second, you only need to make the following changes.
1. Download The jquery-ui-timepicker-addon.js and load it on the page
2. Add the following timepicker style on the page.
Copy codeThe Code is as follows:. ui-timepicker-div. ui-widget-header {margin-bottom: 8px ;}
. Ui-timepicker-div dl {text-align: left ;}
. Ui-timepicker-div dl dt {height: 25px; margin-bottom:-25px ;}
. Ui-timepicker-div dl dd {margin: 0 10px 10px 65px ;}
. Ui-timepicker-div td {font-size: 90% ;}
. Ui-tpicker-grid-label {background: none; border: none; margin: 0; padding: 0 ;}
3. Set the time format of an input in js
Copy codeThe Code is as follows: <input type = "text" id = "datetime" name = "datetime" value = ""/>
Datetimepicker: jquery. ui. datepicker <wbr> Add hour/minute/second
$ ("# Datetime"). datetimepicker (); // Date + hour/second
$ ("# Datetime"). datepicker (); // Date
$ ("# Datetime"). timepicker (); // hour, minute, and second
The above is the jQueryUI DatePicker method to add time and minute, hope to give you a reference, but also hope you can support the house of friends.