浏览代码

Fix the next year is calulated incorrectly, fixed #2152

qingwei.li 8 年之前
父节点
当前提交
02e1cb84ee
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      packages/date-picker/src/basic/date-table.vue

+ 3 - 3
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) {