From cb9484007aa504b5e2ca82e949e8df341d59f256 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 8 May 2019 10:04:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E5=8F=AF=E8=AE=BE=E7=BD=AE=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/datetime/datetime.combo.js | 16 ++++++++-------- src/widget/dynamicdate/dynamicdate.combo.js | 16 ++++++++-------- .../dynamicdatetime/dynamicdatetime.combo.js | 16 ++++++++-------- src/widget/timeinterval/dateinterval.js | 11 ++++++----- src/widget/timeinterval/timeinterval.js | 11 ++++++----- .../yearmonthinterval/yearmonthinterval.js | 11 ++++++----- 6 files changed, 42 insertions(+), 39 deletions(-) diff --git a/src/widget/datetime/datetime.combo.js b/src/widget/datetime/datetime.combo.js index aa8b6e247..71184aa91 100644 --- a/src/widget/datetime/datetime.combo.js +++ b/src/widget/datetime/datetime.combo.js @@ -6,15 +6,15 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { popupHeight: 290, popupWidth: 270, comboAdjustHeight: 1, - border: 1, - DATE_MIN_VALUE: "1900-01-01", - DATE_MAX_VALUE: "2099-12-31" + border: 1 }, _defaultConfig: function () { return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-date-time-combo bi-border bi-border-radius", width: 200, - height: 24 + height: 24, + minDate: "1900-01-01", + maxDate: "2099-12-31" }); }, _init: function () { @@ -31,16 +31,16 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { }; this.trigger = BI.createWidget({ type: "bi.date_time_trigger", - min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE, + min: opts.minDate, + max: opts.maxDate, value: opts.value }); this.popup = BI.createWidget({ type: "bi.date_time_popup", behaviors: opts.behaviors, - min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE, + min: opts.minDate, + max: opts.maxDate, value: opts.value }); self.setValue(this.storeValue); diff --git a/src/widget/dynamicdate/dynamicdate.combo.js b/src/widget/dynamicdate/dynamicdate.combo.js index 86baf4eab..473abc11c 100644 --- a/src/widget/dynamicdate/dynamicdate.combo.js +++ b/src/widget/dynamicdate/dynamicdate.combo.js @@ -3,14 +3,14 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { popupHeight: 259, popupWidth: 270, comboAdjustHeight: 1, - border: 1, - DATE_MIN_VALUE: "1900-01-01", - DATE_MAX_VALUE: "2099-12-31" + border: 1 }, props: { baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius", - height: 22 + height: 22, + minDate: "1900-01-01", + maxDate: "2099-12-31" }, @@ -46,8 +46,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { isNeedAdjustWidth: false, el: { type: "bi.dynamic_date_trigger", - min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE, + min: opts.minDate, + max: opts.maxDate, height: opts.height, value: opts.value, ref: function () { @@ -128,8 +128,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { el: { type: "bi.dynamic_date_popup", behaviors: opts.behaviors, - min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE, + min: opts.minDate, + max: opts.maxDate, value: opts.value, ref: function () { self.popup = this; diff --git a/src/widget/dynamicdatetime/dynamicdatetime.combo.js b/src/widget/dynamicdatetime/dynamicdatetime.combo.js index 6983ee7d0..09536bed3 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.combo.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.combo.js @@ -3,14 +3,14 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { popupHeight: 259, popupWidth: 270, comboAdjustHeight: 1, - border: 1, - DATE_MIN_VALUE: "1900-01-01", - DATE_MAX_VALUE: "2099-12-31" + border: 1 }, props: { baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow", - height: 22 + height: 22, + minDate: "1900-01-01", + maxDate: "2099-12-31" }, @@ -46,8 +46,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { isNeedAdjustWidth: false, el: { type: "bi.dynamic_date_time_trigger", - min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE, + min: opts.minDate, + max: opts.maxDate, height: opts.height, value: opts.value, ref: function () { @@ -128,8 +128,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { el: { type: "bi.dynamic_date_time_popup", behaviors: opts.behaviors, - min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE, + min: opts.minDate, + max: opts.maxDate, value: opts.value, ref: function () { self.popup = this; diff --git a/src/widget/timeinterval/dateinterval.js b/src/widget/timeinterval/dateinterval.js index 253c46ade..12a1d2b27 100644 --- a/src/widget/timeinterval/dateinterval.js +++ b/src/widget/timeinterval/dateinterval.js @@ -7,14 +7,14 @@ BI.DateInterval = BI.inherit(BI.Single, { width: 24, lgap: 15, offset: 0, - timeErrorCls: "time-error", - DATE_MIN_VALUE: "1900-01-01", - DATE_MAX_VALUE: "2099-12-31" + timeErrorCls: "time-error" }, _defaultConfig: function () { var conf = BI.DateInterval.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - extraCls: "bi-date-interval" + extraCls: "bi-date-interval", + minDate: "1900-01-01", + maxDate: "2099-12-31" }); }, _init: function () { @@ -136,7 +136,8 @@ BI.DateInterval = BI.inherit(BI.Single, { BI.print(BI.parseDateTime(date, "%Y-%X-%e"), "%Y-%X-%e") === date; }, _checkVoid: function (obj) { - return !BI.checkDateVoid(obj.year, obj.month, obj.day, this.constants.DATE_MIN_VALUE, this.constants.DATE_MAX_VALUE)[0]; + var o = this.options; + return !BI.checkDateVoid(obj.year, obj.month, obj.day, o.minDate, o.maxDate)[0]; }, _check: function (smallDate, bigDate) { var smallObj = smallDate.match(/\d+/g), bigObj = bigDate.match(/\d+/g); diff --git a/src/widget/timeinterval/timeinterval.js b/src/widget/timeinterval/timeinterval.js index 45f0b892c..83bd84aa0 100644 --- a/src/widget/timeinterval/timeinterval.js +++ b/src/widget/timeinterval/timeinterval.js @@ -7,14 +7,14 @@ BI.TimeInterval = BI.inherit(BI.Single, { width: 24, lgap: 15, offset: 0, - timeErrorCls: "time-error", - DATE_MIN_VALUE: "1900-01-01", - DATE_MAX_VALUE: "2099-12-31" + timeErrorCls: "time-error" }, _defaultConfig: function () { var conf = BI.TimeInterval.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - extraCls: "bi-time-interval" + extraCls: "bi-time-interval", + minDate: "1900-01-01", + maxDate: "2099-12-31" }); }, _init: function () { @@ -136,7 +136,8 @@ BI.TimeInterval = BI.inherit(BI.Single, { BI.print(BI.parseDateTime(date, "%Y-%X-%e %H:%M:%S"), "%Y-%X-%e %H:%M:%S") === date; }, _checkVoid: function (obj) { - return !BI.checkDateVoid(obj.year, obj.month, obj.day, this.constants.DATE_MIN_VALUE, this.constants.DATE_MAX_VALUE)[0]; + var o = this.options; + return !BI.checkDateVoid(obj.year, obj.month, obj.day, o.minDate, o.maxDate)[0]; }, _check: function (smallDate, bigDate) { var smallObj = smallDate.match(/\d+/g), bigObj = bigDate.match(/\d+/g); diff --git a/src/widget/yearmonthinterval/yearmonthinterval.js b/src/widget/yearmonthinterval/yearmonthinterval.js index 8e681c376..80abe69ac 100644 --- a/src/widget/yearmonthinterval/yearmonthinterval.js +++ b/src/widget/yearmonthinterval/yearmonthinterval.js @@ -4,13 +4,13 @@ BI.YearMonthInterval = BI.inherit(BI.Single, { width: 25, lgap: 15, offset: -15, - timeErrorCls: "time-error", - DATE_MIN_VALUE: "1900-01-01", - DATE_MAX_VALUE: "2099-12-31" + timeErrorCls: "time-error" }, props: { - extraCls: "bi-year-month-interval" + extraCls: "bi-year-month-interval", + minDate: "1900-01-01", + macDate: "2099-12-31" }, _init: function () { @@ -117,7 +117,8 @@ BI.YearMonthInterval = BI.inherit(BI.Single, { // 判是否在最大最小之间 _checkVoid: function (obj) { - return !BI.checkDateVoid(obj.year, obj.month, 1, this.constants.DATE_MIN_VALUE, this.constants.DATE_MAX_VALUE)[0]; + var o = this.options; + return !BI.checkDateVoid(obj.year, obj.month, 1, o.minDate, o.maxDate)[0]; }, // 判格式合法