JQuery Mobile Datepicker uses

Source: Internet
Author: User
Tags dateformat

Plugin Introduction File:

<meta name= "viewport" content= "Width=device-width, initial-scale=1" >
<link rel= "stylesheet" href= "Jquery.mobile-git.css"/>
<link rel= "stylesheet" href= "Jquery.mobile.datepicker.css"/>
<link rel= "stylesheet" href= "Jquery.mobile.datepicker.theme.css"/>
<script src= "Http://code.jquery.com/jquery-1.9.1.js" ></script>
<script src= "External/jquery-ui/datepicker.js" ></script>
<script src= "Jquery.mobile-git.js" ></script>
<script src= "Jquery.mobile.datepicker.js" ></script>
<!--Simplified Chinese--
<script src= "Datepicker-zh-cn.js" ></script>
<!--Hide date control input Box--
<style>
. Ui-input-text{display:none;}
</style>

JS section: Gets the selected date:

Default date format
var currentdateojb =$ ("#datepicker"). DatePicker ();//Get Date Object
Currentdate=currentdateobj.val ()//date string
alert (currentdate);

Specify date format
var date= $ ("#datepicker"). DatePicker ({dateformat: "Yy-mm-dd"}). val ()
alert (date);

HTML section:

<input type= "text" id= "DatePicker" data-inline= "true" data-role= "date"/>

Recommendation: http://codego.net/77722/

Appendix:

Datepicker-zh-cn.js content:
/* Chinese initialisation for the jQuery UI date picker plugin. */
/* Written by Cloudream ([email protected]). */
(function (Factory) {
if (typeof define = = = "function" && define.amd) {

Amd. Register as an anonymous module.
Define ([".. /widgets/datepicker "], factory);
} else {

Browser Globals
Factory (Jquery.datepicker);
}
} (function (DatePicker) {

datepicker.regional[' zh-cn ' = {
Closetext: ' Off ',
Prevtext: ' & #x3C; last month ',
Nexttext: ' next month & #x3E; ',
Currenttext: ' Today ',
MonthNames: [' January ', ' February ', ' March ', ' April ', ' May ', ' June ',
' July ', ' August ', ' September ', ' October ', ' November ', ' December ',
Monthnamesshort: [' January ', ' February ', ' March ', ' April ', ' May ', ' June ',
' July ', ' August ', ' September ', ' October ', ' November ', ' December ',
DayNames: [' Sunday ', ' Monday ', ' Tuesday ', ' Wednesday ', ' Thursday ', ' Friday ', ' Saturday '],
Daynamesshort: [' Sunday ', ' Monday ', ' Tuesday ', ' Wednesday ', ' Thursday ', ' Friday ', ' Saturday '],
Daynamesmin: [' Day ', ' one ', ' two ', ' three ', ' four ', ' five ', ' six '],
Weekheader: ' Week ',
DateFormat: ' Yy-mm-dd ',
Firstday:1,
Isrtl:false,
Showmonthafteryear:true,
Yearsuffix: ' Year '};
Datepicker.setdefaults (datepicker.regional[' ZH-CN ');

Return datepicker.regional[' ZH-CN '];

}));

JQuery Mobile Datepicker uses

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.