Set jQueryUI DatePicker The default language is Chinese _jquery

Source: Internet
Author: User

The DatePicker control is in English by default, and you can specify the Chinese display value for the month and day by the MonthNames, DayNames properties when constructing DatePicker, but it's too much trouble to configure these properties every time you use it. Can add a JS file to the Chinese configuration are placed inside, each use of direct reference can be placed here in the Jquery.ui.datepicker-zh-cn.js, the contents are as follows:

Copy Code code as follows:
JQuery (function ($) {
$.datepicker.regional[' ZH-CN '] = {
Closetext: ' Close ',
Prevtext: ' < last month ',
Nexttext: ' Next month > ',
Currenttext: ' Today ',
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 '],
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: ' Zhou ',
DateFormat: ' Yy-mm-dd ',
Firstday:1,
Isrtl:false,
Showmonthafteryear:true,
Yearsuffix: ' Year '};
$.datepicker.setdefaults ($.datepicker.regional[' ZH-CN '));
});

Introduced after the Jquery.ui.datepicker.js

Copy Code code as follows:
<script src= "Js/jquery.ui.datepicker-zh-cn.js" type= "Text/javascript" ></script>

The above is jQueryUI DatePicker set Chinese method, if you still feel trouble, you can directly modify the Jquery.ui.datepicker.js, the corresponding English part into Chinese (if only to do Chinese development), once and for all.

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.