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.