JQueryUI DatePicker: Add hour/minute/second, jqueryuidatepicker

Source: Internet
Author: User
Tags add time

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.