diff --git a/changelog.md b/changelog.md index 063ebead2e..6f0170b557 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-07) +- 修复了日期类型控件先展开切换日期月份面板,再设置区间使得该月份不合法,查看该月份面板灰化不对的问题 - bi.file文件上传控件accept属性与 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) 统一 - 修复了日期类型控件设置一个不在minDate和maxDate之间的日期值时,面板灰化与翻页按钮状态不对的问题 - BI.OB的on方法返回一个解除监听的函数 diff --git a/src/base/combination/navigation.js b/src/base/combination/navigation.js index 21a1f3ef5a..4419e0f3ac 100644 --- a/src/base/combination/navigation.js +++ b/src/base/combination/navigation.js @@ -124,6 +124,10 @@ BI.Navigation = BI.inherit(BI.Widget, { } }, + getAllCard: function() { + return BI.values(this.cardMap); + }, + /** * @override */ diff --git a/src/widget/date/calendar/picker.date.js b/src/widget/date/calendar/picker.date.js index dbb28bb723..9189e52bc1 100644 --- a/src/widget/date/calendar/picker.date.js +++ b/src/widget/date/calendar/picker.date.js @@ -136,7 +136,7 @@ BI.DatePicker = BI.inherit(BI.Widget, { if (!BI.contains(allowMonth, month)) { month = allowMonth[0]; } - + this.month.setValue(month); return month; }, diff --git a/src/widget/date/calendar/popup.calendar.date.js b/src/widget/date/calendar/popup.calendar.date.js index 298fedd059..e76c4faece 100644 --- a/src/widget/date/calendar/popup.calendar.date.js +++ b/src/widget/date/calendar/popup.calendar.date.js @@ -103,17 +103,17 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, { }, _checkMin: function () { - var calendar = this.calendar.getSelectedCard(); - if (BI.isNotNull(calendar)) { - calendar.setMinDate(this.options.min); - } + var o = this.options; + BI.each(this.calendar.getAllCard(), function (idx, calendar) { + calendar.setMinDate(o.min); + }); }, _checkMax: function () { - var calendar = this.calendar.getSelectedCard(); - if (BI.isNotNull(calendar)) { - calendar.setMaxDate(this.options.max); - } + var o = this.options; + BI.each(this.calendar.getAllCard(), function (idx, calendar) { + calendar.setMaxDate(o.max); + }); }, setMinDate: function (minDate) {