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