From 588161a0200adf9e17b689f7c812667acaf751f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Tue, 7 Sep 2021 11:35:56 +0800 Subject: [PATCH] fix DatePicker problem --- src/components/date-picker/panel/Date/date-range.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/date-picker/panel/Date/date-range.vue b/src/components/date-picker/panel/Date/date-range.vue index 1fbc9586..154a9db1 100644 --- a/src/components/date-picker/panel/Date/date-range.vue +++ b/src/components/date-picker/panel/Date/date-range.vue @@ -298,7 +298,10 @@ const current = new Date(this[`${panel}PanelDate`]); // fix https://github.com/view-design/ViewUI/issues/418 // 强行把左视图日期设置为1号 - current[`set${type}`](current[`get${type}`]() + increment, 1); + // FullYear 不能设置https://github.com/iview/iview/issues/6600 + if (type === 'FullYear') current[`set${type}`](current[`get${type}`]() + increment); + else current[`set${type}`](current[`get${type}`]() + increment, 1); + this[`${panel}PanelDate`] = current; if (!updateOtherPanel) return;