From 4133468906ab31d814217e85ecd581b277bba845 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 24 Jun 2019 10:59:00 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-18389=20fix:=20=E9=99=90=E5=88=B6?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E5=90=8E=EF=BC=8C=E5=B9=B4=E4=BB=BD=E7=9A=84?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/button/button.basic.js | 2 +- src/case/calendar/calendar.year.js | 5 ++++- src/widget/date/calendar/popup.year.js | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index efad22775..bfc1090c9 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -409,4 +409,4 @@ BI.BasicButton = BI.inherit(BI.Single, { BI.BasicButton.superclass.destroy.apply(this, arguments); } }); -BI.BasicButton.EVENT_CHANGE = "EVENT_CHANGE"; \ No newline at end of file +BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; \ No newline at end of file diff --git a/src/case/calendar/calendar.year.js b/src/case/calendar/calendar.year.js index f7e0fb19a..cd70532be 100644 --- a/src/case/calendar/calendar.year.js +++ b/src/case/calendar/calendar.year.js @@ -24,9 +24,12 @@ BI.YearCalendar = BI.inherit(BI.Widget, { Y = Y | 0; var start = BI.YearCalendar.getStartYear(Y); var items = []; + // 对于年控件来说,只要传入的minDate和maxDate的year区间包含v就是合法的 + var startDate = BI.parseDateTime(o.min, "%Y-%X-%d"); + var endDate = BI.parseDateTime(o.max, "%Y-%X-%d"); BI.each(BI.range(BI.YearCalendar.INTERVAL), function (i) { var td = {}; - if (BI.checkDateVoid(start + i, 1, 1, o.min, o.max)[0]) { + if (BI.checkDateVoid(start + i, 1, 1, BI.print(BI.getDate(startDate.getFullYear(), 0, 1), "%Y-%X-%d"), BI.print(BI.getDate(endDate.getFullYear(), 0, 1), "%Y-%X-%d"))[0]) { td.disabled = true; } td.text = start + i; diff --git a/src/widget/date/calendar/popup.year.js b/src/widget/date/calendar/popup.year.js index f0d479593..15654c004 100644 --- a/src/widget/date/calendar/popup.year.js +++ b/src/widget/date/calendar/popup.year.js @@ -95,7 +95,10 @@ BI.YearPopup = BI.inherit(BI.Widget, { setValue: function (v) { var o = this.options; v = BI.parseInt(v); - if (BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]) { + // 对于年控件来说,只要传入的minDate和maxDate的year区间包含v就是合法的 + var startDate = BI.parseDateTime(o.min, "%Y-%X-%d"); + var endDate = BI.parseDateTime(o.max, "%Y-%X-%d"); + if (BI.checkDateVoid(v, 1, 1, BI.print(BI.getDate(startDate.getFullYear(), 0, 1), "%Y-%X-%d"), BI.print(BI.getDate(endDate.getFullYear(), 0, 1), "%Y-%X-%d"))[0]) { v = BI.getDate().getFullYear(); this.selectedYear = ""; this.navigation.setSelect(BI.YearCalendar.getPageByYear(v));