From 567a965b90db96af50fce2a75eaf555d428ae848 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 19 Apr 2018 22:07:15 +0800 Subject: [PATCH] BI-18028 --- dist/bundle.js | 13 +++++++++---- dist/widget.js | 13 +++++++++---- src/widget/dynamicdate/dynamicdate.trigger.js | 7 +++++-- .../dynamicdatetime/dynamicdatetime.trigger.js | 6 ++++-- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/dist/bundle.js b/dist/bundle.js index fe719b167..ddb59260b 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -91168,7 +91168,8 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger hgap: 4, vgap: 2, yearLength: 4, - yearMonthLength: 7 + yearMonthLength: 6, + yearFullMonthLength: 7 }, props: { @@ -91282,6 +91283,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger } break; case this._const.yearMonthLength: + case this._const.yearFullMonthLength: if (this._monthCheck(v)) { this.editor.setValue(v + "-"); } @@ -91297,7 +91299,8 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger _monthCheck: function (v) { var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d"); - return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max; + return (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v || + BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max; }, _setInnerValue: function (date, text) { @@ -92058,7 +92061,8 @@ BI.extend(BI.DynamicDateTimeSelect, { hgap: 4, vgap: 2, yearLength: 4, - yearMonthLength: 7 + yearMonthLength: 6, + yearFullMonthLength: 7 }, props: { @@ -92190,7 +92194,8 @@ BI.extend(BI.DynamicDateTimeSelect, { _monthCheck: function (v) { var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d"); - return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max; + return (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v || + BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max; }, _setInnerValue: function (date, text) { diff --git a/dist/widget.js b/dist/widget.js index 38bba7e6c..7f2f1ff7c 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -4031,7 +4031,8 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger hgap: 4, vgap: 2, yearLength: 4, - yearMonthLength: 7 + yearMonthLength: 6, + yearFullMonthLength: 7 }, props: { @@ -4145,6 +4146,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger } break; case this._const.yearMonthLength: + case this._const.yearFullMonthLength: if (this._monthCheck(v)) { this.editor.setValue(v + "-"); } @@ -4160,7 +4162,8 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger _monthCheck: function (v) { var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d"); - return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max; + return (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v || + BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max; }, _setInnerValue: function (date, text) { @@ -4921,7 +4924,8 @@ BI.extend(BI.DynamicDateTimeSelect, { hgap: 4, vgap: 2, yearLength: 4, - yearMonthLength: 7 + yearMonthLength: 6, + yearFullMonthLength: 7 }, props: { @@ -5053,7 +5057,8 @@ BI.extend(BI.DynamicDateTimeSelect, { _monthCheck: function (v) { var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d"); - return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max; + return (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v || + BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max; }, _setInnerValue: function (date, text) { diff --git a/src/widget/dynamicdate/dynamicdate.trigger.js b/src/widget/dynamicdate/dynamicdate.trigger.js index 71af63ae8..6743d573e 100644 --- a/src/widget/dynamicdate/dynamicdate.trigger.js +++ b/src/widget/dynamicdate/dynamicdate.trigger.js @@ -3,7 +3,8 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { hgap: 4, vgap: 2, yearLength: 4, - yearMonthLength: 7 + yearMonthLength: 6, + yearFullMonthLength: 7 }, props: { @@ -117,6 +118,7 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { } break; case this._const.yearMonthLength: + case this._const.yearFullMonthLength: if (this._monthCheck(v)) { this.editor.setValue(v + "-"); } @@ -132,7 +134,8 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { _monthCheck: function (v) { var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d"); - return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max; + return (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v || + BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max; }, _setInnerValue: function (date, text) { diff --git a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js index ead3a9c08..53538b39d 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js @@ -3,7 +3,8 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { hgap: 4, vgap: 2, yearLength: 4, - yearMonthLength: 7 + yearMonthLength: 6, + yearFullMonthLength: 7 }, props: { @@ -135,7 +136,8 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { _monthCheck: function (v) { var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d"); - return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max; + return (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v || + BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v) && date >= this.options.min && date <= this.options.max; }, _setInnerValue: function (date, text) {