Browse Source

Pull request #1753: BI-80994 fix:初始化设置可选区间后,minDate没有同步改变

Merge in VISUAL/fineui from ~CLAIRE.TANG/fineui:master to master

* commit '6b899f485b2b7e684d4f4acc96fd259ad12956ed':
  BI-80994 fix:初始化设置可选区间后,minDate没有同步改变
es6
Claire.Tang 4 years ago
parent
commit
433e6e2547
  1. 3
      src/widget/yearmonth/trigger.yearmonth.js
  2. 3
      src/widget/yearquarter/trigger.yearquarter.js

3
src/widget/yearmonth/trigger.yearmonth.js

@ -62,13 +62,12 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
_createEditor: function (isYear) {
var self = this, o = this.options, c = this._const;
var minDate = BI.parseDateTime(o.min, "%Y-%X-%d");
var editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
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) && !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 <= 12) && !BI.checkDateVoid(self.yearEditor.getValue(), v, 1, o.min, o.max)[0]);

3
src/widget/yearquarter/trigger.yearquarter.js

@ -60,13 +60,12 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
_createEditor: function (isYear) {
var self = this, o = this.options, c = this._const;
var minDate = BI.parseDateTime(o.min, "%Y-%X-%d");
var editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
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) && !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]);
},

Loading…
Cancel
Save