How to use jquery date control

(*-*)浩
Release: 2019-06-15 18:02:29
Original
3060 people have browsed it

JQuery is a very excellent scripting framework. Its rich controls are very simple to use and the configuration is very flexible. Below is an example of using the date plug-in datapicker.

How to use jquery date control

Needless to say, download the jQuery core file. Datepicker is a lightweight plug-in. You only need the min version of jQuery. Then go to the official website to download the jquery-ui compressed package. (You can choose your favorite theme), which includes support for datepicker. Of course, you can also download datepicker from the official website, including ui.core.js and ui.datepicker.js.

Recommended courses:jQuery Tutorial.

jquery.ui.datepicker-zh-CN.js, the content is as follows:

jQuery(function($){ $.datepicker.regional['zh-CN'] = { closeText: '关闭', prevText: '<上月', nextText: '下月>', currentText: '今天', monthNames: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'], monthNamesShort: ['一','二','三','四','五','六', '七','八','九','十','十一','十二'], dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], dayNamesMin: ['日','一','二','三','四','五','六'], weekHeader: '周', dateFormat: 'yy-mm-dd', firstDay: 1, isRTL: false, showMonthAfterYear: true, yearSuffix: '年'}; $.datepicker.setDefaults($.datepicker.regional['zh-CN']); });
Copy after login

Instance:

    日期控件datepicker            
    
Copy after login

Note:Since jquery datepicker is not the latest version, downloading the css file in the new version jquery-ui-1.8.13 will cause the date control to be unable to be displayed, so the ui of 1.7.3 is used here. The simpler way is to use jquery-ui to compress js.

The above is the detailed content of How to use jquery date control. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!