我有這個JavaScript代碼,我想這應該是代碼必須改變的地方。修改javascript以讓顯示前幾年
if (this.options.showYear) {
str += '<select tabindex="'+this.tabIndex+'" class="' + this.options.yearClass + '">';
if (this.options.yearOrder == 'desc'){
for (var y = this.options.yearStart; y > (this.options.yearStart - this.options.yearRange - 1); y--){
str += this.addOption(y,y,parseInt(this.calendarYear));
}
} else {
for (var y = this.options.yearStart; y < (this.options.yearStart + this.options.yearRange + 1); y++){
str += this.addOption(y,y,parseInt(this.calendarYear));
}
}
日曆目前只顯示2013以上,我至少需要2012 .. 請幫助我! 感謝
dayChars: 1,
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], // Leap year is added later
format: 'yyyy/mm/dd', // How the output looks after selection
yearStart: (new Date().getFullYear()), // Default starting year for dropdown options is 5 years ago
yearRange: 10, // Show a 10 year span
yearOrder: 'asc', // Counting up in years
startDay: 7
您的上下文對象具有propertie'options'它也有一個'yearStart' propertie,將其更改爲您的需求 – C5H8NNaO4
多一點背景請。 「選項」在哪裏定義? – ATOzTOA
信息太少。這是一個猜謎遊戲。此外,你不會顯示任何努力或見解。 – Amberlamps