0

我已经安装了这个 slimpicker,我正在使用它。

这个想法是:我对年份的选择有疑问,如果我选择 2012,我会得到类似:dd/mm/112

如果我选择 2013 虽然我得到:dd/mm/2013

这很奇怪。这是js的数据:

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: 'mm/dd/yyyy',                                          // 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                       // 1 = week starts on Monday, 7 = week starts on Sunday
    },
4

1 回答 1

2

在 slimpicker.js 中搜索代码如下

// 要在日历上显示的日期

this.currentYear = this.calendarYear = this.current.getYear();
this.currentMonth = this.calendarMonth = this.current.getMonth();
this.currentDay = this.current.getDate();

并将其更改如下

// 要在日历上显示的日期

this.currentYear = this.calendarYear = this.current.getFullYear();
this.currentMonth = this.calendarMonth = this.current.getMonth();
this.currentDay = this.current.getDate();
于 2013-11-14T16:07:25.837 回答