From 8f14d5f4aea3b0a821b53e17cccb20c6777f321e Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 31 Aug 2020 14:32:05 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-5172=20fix:=20v=E4=B8=BAstring=E6=97=B6?= =?UTF-8?q?=E6=B0=B8=E4=B8=8D=3D=3D=3D=E4=B8=8D=E6=88=90=E7=AB=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/yearmonth/trigger.yearmonth.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/widget/yearmonth/trigger.yearmonth.js b/src/widget/yearmonth/trigger.yearmonth.js index 1c062f7d56..fb947bff51 100644 --- a/src/widget/yearmonth/trigger.yearmonth.js +++ b/src/widget/yearmonth/trigger.yearmonth.js @@ -67,9 +67,10 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { type: "bi.sign_editor", height: o.height, validationChecker: function (v) { - if(isYear) { - return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, v === minDate.getFullYear() ? minDate.getMonth() + 1 : 1, 1, o.min, o.max)[0]); + if (isYear) { + return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, parseInt(v, 10) === minDate.getFullYear() ? minDate.getMonth() + 1 : 1, 1, o.min, o.max)[0]); } + return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); }, quitChecker: function () {