1. Localization
You can directly load the file or add the following statement after the script.
Copy codeThe Code is as follows:
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']);
});
2. Click Today (Today) to display the date directly in the input, instead of redirecting to the current place. It is easy to click the date modification method again. Add this code in the script.
Copy codeThe Code is as follows:
$. Datepicker. _ gotoToday = function (id ){
Var target = $ (id );
Var inst = this. _ getInst (target [0]);
If (this. _ get (inst, 'gostream') & inst. currentDay ){
Inst. selectedDay = inst. currentDay;
Inst. drawMonth = inst. selectedMonth = inst. currentMonth;
Inst. drawYear = inst. selectedYear = inst. currentYear;
}
Else {
Var date = new Date ();
Inst. selectedDay = date. getDate ();
Inst. drawMonth = inst. selectedMonth = date. getMonth ();
Inst. drawYear = inst. selectedYear = date. getFullYear ();
This. _ setDateDatepicker (target, date );
This. _ selectDate (id, this. _ getDateDatepicker (target ));
}
This. _ policychange (inst );
This. _ adjustDate (target );
}