From 71286e13d3f647e72b34104586d34e167018a499 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 2 Feb 2021 10:06:38 +0800 Subject: [PATCH] =?UTF-8?q?QFX-4170=20&&=20BI-81317=20=E4=BF=AE=E7=81=B0?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/year/card.year.js | 6 +++--- src/widget/yearquarter/trigger.yearquarter.js | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/widget/year/card.year.js b/src/widget/year/card.year.js index bc3fe6a58..b747d104b 100644 --- a/src/widget/year/card.year.js +++ b/src/widget/year/card.year.js @@ -103,9 +103,9 @@ BI.StaticYearCard = BI.inherit(BI.Widget, { afterCardShow: function () { this.setValue(self.selectedYear); - var calendar = this.getSelectedCard(); - self.backBtn.setEnable(!calendar.isFrontYear()); - self.preBtn.setEnable(!calendar.isFinalYear()); + // var calendar = this.getSelectedCard(); + // self.backBtn.setEnable(!calendar.isFrontYear()); + // self.preBtn.setEnable(!calendar.isFinalYear()); } }); diff --git a/src/widget/yearquarter/trigger.yearquarter.js b/src/widget/yearquarter/trigger.yearquarter.js index b6abb201f..cdebb770d 100644 --- a/src/widget/yearquarter/trigger.yearquarter.js +++ b/src/widget/yearquarter/trigger.yearquarter.js @@ -67,7 +67,9 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { if(isYear) { return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, parseInt(v, 10) === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear() ? BI.parseDateTime(o.min, "%Y-%X-%d").getMonth() + 1 : 1, 1, o.min, o.max)[0]); } - return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 4) && !BI.checkDateVoid(self.yearEditor.getValue(), (v - 1) * 3 + 1, 1, o.min, o.max)[0]); + var year = self.yearEditor.getValue(); + + return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 4) && (BI.isEmptyString(year) ? true : !BI.checkDateVoid(self.yearEditor.getValue(), (v - 1) * 3 + 1, 1, o.min, o.max)[0])); }, quitChecker: function () { return false;