JQuery Datepicker Chinese

Source: Internet
Author: User
Tags website performance

JQuery Datepicker has never been used before when using js. It is very useful for the first use today. When using this function, you need to display the calendar text as Chinese. Open the link at the front and bottom of the article to see how to display the jQuery Datepicker text as Chinese:

JQuery (function ($ ){
$. Datepicker. regional ['zh-cn'] = {
CloseText: 'close ',
PrevText: '<last month ',
NextText: 'Next month> ',
CurrentText: 'Today ',
MonthNames: ['August 11', 'August 11', 'August 11', 'August 11', 'August 11 ',
'October ', 'October'],
MonthNamesShort: ['1', '2', '3', '4', '5', '6 ',
'7', '8', '9', '10', '11', '12'],
DayNames: ['sunday', 'monday', 'tuesday', 'weday', 'thursday', 'Friday'],
DayNamesShort: ['sunday', 'monday', 'tues', 'wedneth', 'thurs', 'Friday', 'satur'],
DayNamesMin: ['day', 'yi', '2', '3', '4', '5', '6'],
WeekHeader: 'Week ',
DateFormat: 'yy-mm-dd ',
FirstDay: 1,
IsRTL: false,
ShowMonthAfterYear: true,
YearSuffix: 'Year '};
$. Datepicker. setDefaults ($. datepicker. regional ['zh-cn']);
});
When this file is introduced for use, jQuery Datepicker will display Simplified Chinese, but for tb website performance, it is best to integrate it into a js file.

$ (Document). ready (function (){
$ ("# Sdate, # edate"). datepicker ();
});
You can also add other options for use, as shown below. For details, refer to the jQuery Datepicker official documentation.

$ (Document). ready (function (){
$ ("# Sdate, # edate"). datepicker ({
NumberOfMonths: 2, // display for two months
MinDate: 0 // optional from the current date
});
});
Author: tbwshc

Related Article

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.