Browse Source

KERNEL-5172 fix: v为string时永不===不成立

es6
iapyang 4 years ago
parent
commit
8f14d5f4ae
  1. 5
      src/widget/yearmonth/trigger.yearmonth.js

5
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 () {

Loading…
Cancel
Save