2012-12-18 58 views
0

我有這個slimpicker安裝,以及我使用它。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 
    }, 
+0

您可以將代碼發佈到您讀取值並獲得錯誤結果的地方嗎? –

+0

從你的代碼可以。 http://jsfiddle.net/oamiamgod/5DvfC/ – OammieR

+0

是的..抱歉..謝謝你們 – ossial

回答

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();