From 02e1cb84ee419f4a403fdf92c16671fd021de2d6 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Wed, 4 Jan 2017 14:33:58 +0800 Subject: [PATCH] Fix the next year is calulated incorrectly, fixed #2152 --- packages/date-picker/src/basic/date-table.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/date-picker/src/basic/date-table.vue b/packages/date-picker/src/basic/date-table.vue index 052e071df..ce269353e 100644 --- a/packages/date-picker/src/basic/date-table.vue +++ b/packages/date-picker/src/basic/date-table.vue @@ -367,8 +367,8 @@ target = target.parentNode.cells[1]; } - let year = this.year; - let month = this.month; + let year = Number(this.year); + let month = Number(this.month); const cellIndex = target.cellIndex; const rowIndex = target.parentNode.rowIndex; @@ -377,7 +377,7 @@ const text = cell.text; const className = target.className; - const newDate = new Date(this.year, this.month, 1); + const newDate = new Date(year, month, 1); if (className.indexOf('prev') !== -1) { if (month === 0) {