jquery date control that is accurate to seconds

Source: Internet
Author: User

The project requires a date control that is accurate to the second, searches the web and discovers that a jquery control can implement the function---timerpicker. However, the official web site does not provide a complete demo of the control, and did not provide Chinese packaging, so I have a bit of a Chinese, for the needs of friends reference.

As follows:


First, refer to the library in the page:

<Linktype= "Text/css"href= "Css/jquery-ui-1.8.17.custom.css"rel= "stylesheet" /><Linktype= "Text/css"href= "Css/jquery-ui-timepicker-addon.css"rel= "stylesheet" /><Scripttype= "Text/javascript"src= "Js/jquery-1.7.1.min.js"></Script><Scripttype= "Text/javascript"src= "Js/jquery-ui-1.8.17.custom.min.js"></Script><Scripttype= "Text/javascript"src= "Js/jquery-ui-timepicker-addon.js"></Script><Scripttype= "Text/javascript"src= "Js/jquery-ui-timepicker-zh-cn.js"></Script>

Chinese Package Code:

(function ($) {    //The Datepicker of Chinese$.datepicker.regional[' ZH-CN '] ={cleartext:' Clear ', Clearstatus: ' Clear selected date ', Closetext:' Off ', Closestatus: ' Do not change the current selection ', Prevtext:' < last month ', Prevstatus: ' Show last month ', Nexttext:' Next month > ', Nextstatus: ' Show next month ', Currenttext:' Today ', Currentstatus: ' Show this month ', monthNames: [' January ', ' February ', ' March ', ' April ', ' May ', ' June ',        ' July ', ' August ', ' September ', ' October ', ' November ', ' December '], monthnamesshort: [' One ', ' two ', ' three ', ' four ', ' five ', ' six ',        ' Seven ', ' eight ', ' nine ', ' ten ', ' 11 ', ' 12 '], Monthstatus:' Select Month ', Yearstatus: ' Select Year ', Weekheader:' Week ', Weekstatus: ' Week of the Year ', dayNames: [' Sunday ', ' Monday ', ' Tuesday ', ' Wednesday ', ' Thursday ', ' Friday ', ' Saturday '], daynamesshort: [' Sunday ', ' Monday ', ' Tuesday ', ' Wednesday ', ' Thursday ', ' Friday ', ' Saturday '], daynamesmin: [' Day ', ' one ', ' two ', ' three ', ' four ', ' five ', ' six '], Daystatus:' Set DD for one week start ', Datestatus: ' Select M-D, DD ', DateFormat:' Yy-mm-dd ', firstday:1, Initstatus:' Please select a date ', Isrtl:false    }; $.datepicker.setdefaults ($.datepicker.regional[' ZH-CN ']); //The Timepicker of Chinese$.timepicker.regional[' ZH-CN '] ={timeonlytitle:' Choose Time ', timetext:Time, Hourtext:Hours, Minutetext:Minutes, Secondtext:Seconds, Millisectext:microseconds, Timezonetext:Time zone, Currenttext:' Time Now ', Closetext:Close, TimeFormat:' hh:mm ', amnames: [' AM ', ' A '], pmnames: [' PM ', ' P '], ampm:false    }; $.timepicker.setdefaults ($.timepicker.regional[' ZH-CN ']);}) (jQuery);

Note: The logic of Chinese is to set the language pack content of the "ZH-CN" tag, and then set the default language to "ZH-CN".

The completion Code of the demo page is:

<!DOCTYPE HTML><HTML><Head>    <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" />    <title>Timepicker Demo</title>    <Linktype= "Text/css"href= "Css/jquery-ui-1.8.17.custom.css"rel= "stylesheet" />    <Linktype= "Text/css"href= "Css/jquery-ui-timepicker-addon.css"rel= "stylesheet" />    <Scripttype= "Text/javascript"src= "Js/jquery-1.7.1.min.js"></Script>    <Scripttype= "Text/javascript"src= "Js/jquery-ui-1.8.17.custom.min.js"></Script>    <Scripttype= "Text/javascript"src= "Js/jquery-ui-timepicker-addon.js"></Script>    <Scripttype= "Text/javascript"src= "Js/jquery-ui-timepicker-zh-cn.js"></Script>    <Scripttype= "Text/javascript">        $(function () {            $(". Ui_timepicker"). DateTimePicker ({//Showon: "button",                //buttonimage: "./css/images/icon_calendar.gif",                //Buttonimageonly:true,Showsecond:true, TimeFormat:'Hh:mm:ss', Stephour:1, Stepminute:1, Stepsecond:1            })        })    </Script></Head><Body>    <P>        <inputtype= "text"name= "datetime"class= "Ui_timepicker"value=""></P></Body></HTML>

Demo Download: The jquery date control that is accurate to the second

From: http://www.cnblogs.com/tianzhiliang/archive/2012/10/31/2747641.html

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.