Jquery-ui Date Time Control implementation

Source: Internet
Author: User
Tags dateformat set time

Date controls and time controls are standalone controls, datetime controls are imported at the same time as the date control and JS of the time control, and then the date control is added to the time control to display the parameters without importing the time control JS. Date control function sets the time control to be wrapped incorrectly

Date Control official website website: http://jqueryui.com/

Date control JS:jquery-ui.js

corresponding functions and default property settings: Function Datepicker()


Time Control official website website: http://plugins.jquery.com/jt.timepicker/

Time Control Js:jquery-ui-timepicker-addon.js

corresponding functions and default property settings: Function timepicker()



$ (function () {/** * Sets the time format for time fields TODO need to consider optimizing selectors. Exclude hidden type *//Date with time (to avoid being overwritten in front of the Hour)//$ (' input[id$=datetime],[id$=datetime],[id$=datetime],[id$=datetime],[ Class$=datetime]. DateTimePicker ({showsecond:true,hourgrid:4,minutegrid:10, TimeFormat: ' Hh:mm:ss '}); $ (' input[ id$=datetime],[id$=datetime],[id$=datetime],[id$=datetime],[class$=datetime],[class$=datetime],[class$= Datetime],[class$=datetime]. DateTimePicker ({daynamesmin: [' Day ', ' one ', ' two ', ' three ', ' four ', ' five ', ' VI '],//set the week name of the control to show FirstDay: 1,//Set the day of the week in the first column, Sunday is 0. Monday is 1, and so on. Changemonth:true,//Change month drop-down box changeyear:true,//Change year drop-down box showsecond:true,//show milliseconds monthnamesshort:[' January ', ' February ', ' March ', ' April ' , ' May ', ' June ', ' July ', ' August ', ' September ', ' October ', ' November ', ' December '],timeformat: ' hh:mm:ss ',//Set time format dateformat: ' Yy-mm-dd ',// Set Date format hourgrid:4,//show time ruler minutegrid:10,secondgrid:10});//Date $ (' input[id$=date],[id$=date],[class$=date],[class$ =date]. DatePicker ({daynamesmin: [' Day ', ' one ', ' two ', ' three ', ' four ', ' five ', ' VI '],//set the control's week name to show Firstday:1,//Set the day of the week in the first column, Sunday for 0, week One is 1, and so on. ChangemOnth:true,//Change month dropdown box changeyear:true,//Change year dropdown box monthnamesshort:[' January ', ' February ', ' March ', ' April ', ' May ', ' June ', ' July ', ' August ', ' September ', ' October ' ', ' November ', ' December '],dateformat: ' YY-MM-DD '//Set date format});//time display seconds set format $ (' input[id$=time],[id$=time],[class$=time] '). Timepicker ({showsecond:true,timeformat: ' Hh:mm:ss ', Hstep: ' 2 ', hourgrid:4,minutegrid:10});});


Display effects such as the following:

Date Time Control


Date control


Time Control:





Jquery-ui Date Time Control implementation

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.