diff --git a/bi/base.js b/bi/base.js index 871dd8e95..511fb732d 100644 --- a/bi/base.js +++ b/bi/base.js @@ -1135,7 +1135,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { }, removeItemAt: function (indexes) { - BI.remove(this.buttons, indexes); + BI.removeAt(this.buttons, indexes); this.layouts.removeItemAt(indexes); }, diff --git a/bi/case.js b/bi/case.js index ecfa47fc6..3c9e1d261 100644 --- a/bi/case.js +++ b/bi/case.js @@ -7181,6 +7181,13 @@ BI.ListPane = BI.inherit(BI.Pane, { this.check(); }, + removeItemAt: function (indexes) { + indexes = indexes || []; + BI.removeAt(this.options.items, indexes); + this.button_group.removeItemAt.apply(this.button_group, arguments); + this.check(); + }, + populate: function (items) { var self = this, o = this.options; if (arguments.length === 0 && (BI.isFunction(this.button_group.attr("itemsCreator")))) {//接管loader的populate方法 diff --git a/bi/core.js b/bi/core.js index 782e18b6c..744231b76 100644 --- a/bi/core.js +++ b/bi/core.js @@ -6374,6 +6374,20 @@ Date.prototype.getQuarterStartMonth = function () { } return quarterStartMonth; }; + +//指定日期n个月之前或之后的日期 +Date.prototype.getOffsetMonth = function (n) { + var dt = new Date(this.getTime()); + var day = dt.getDate(); + var monthDay = new Date(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays(); + if(day > monthDay){ + day = monthDay; + } + dt.setDate(day); + dt.setMonth(dt.getMonth() + parseInt(n)); + return dt; +}; + //获得本季度的起始日期 Date.prototype.getQuarterStartDate = function () { return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1); diff --git a/docs/base.js b/docs/base.js index 871dd8e95..511fb732d 100644 --- a/docs/base.js +++ b/docs/base.js @@ -1135,7 +1135,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { }, removeItemAt: function (indexes) { - BI.remove(this.buttons, indexes); + BI.removeAt(this.buttons, indexes); this.layouts.removeItemAt(indexes); }, diff --git a/docs/case.js b/docs/case.js index ecfa47fc6..3c9e1d261 100644 --- a/docs/case.js +++ b/docs/case.js @@ -7181,6 +7181,13 @@ BI.ListPane = BI.inherit(BI.Pane, { this.check(); }, + removeItemAt: function (indexes) { + indexes = indexes || []; + BI.removeAt(this.options.items, indexes); + this.button_group.removeItemAt.apply(this.button_group, arguments); + this.check(); + }, + populate: function (items) { var self = this, o = this.options; if (arguments.length === 0 && (BI.isFunction(this.button_group.attr("itemsCreator")))) {//接管loader的populate方法 diff --git a/docs/core.js b/docs/core.js index 015d1c47f..429e62f8f 100644 --- a/docs/core.js +++ b/docs/core.js @@ -23854,6 +23854,20 @@ Date.prototype.getQuarterStartMonth = function () { } return quarterStartMonth; }; + +//指定日期n个月之前或之后的日期 +Date.prototype.getOffsetMonth = function (n) { + var dt = new Date(this.getTime()); + var day = dt.getDate(); + var monthDay = new Date(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays(); + if(day > monthDay){ + day = monthDay; + } + dt.setDate(day); + dt.setMonth(dt.getMonth() + parseInt(n)); + return dt; +}; + //获得本季度的起始日期 Date.prototype.getQuarterStartDate = function () { return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1); diff --git a/src/base/combination/group.button.js b/src/base/combination/group.button.js index d303feeeb..2da4ee7fd 100644 --- a/src/base/combination/group.button.js +++ b/src/base/combination/group.button.js @@ -158,7 +158,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { }, removeItemAt: function (indexes) { - BI.remove(this.buttons, indexes); + BI.removeAt(this.buttons, indexes); this.layouts.removeItemAt(indexes); }, diff --git a/src/case/layer/pane.list.js b/src/case/layer/pane.list.js index b7faf2758..fcedfc8b3 100644 --- a/src/case/layer/pane.list.js +++ b/src/case/layer/pane.list.js @@ -101,6 +101,13 @@ BI.ListPane = BI.inherit(BI.Pane, { this.check(); }, + removeItemAt: function (indexes) { + indexes = indexes || []; + BI.removeAt(this.options.items, indexes); + this.button_group.removeItemAt.apply(this.button_group, arguments); + this.check(); + }, + populate: function (items) { var self = this, o = this.options; if (arguments.length === 0 && (BI.isFunction(this.button_group.attr("itemsCreator")))) {//接管loader的populate方法 diff --git a/src/core/proto/date.js b/src/core/proto/date.js index 1ae8b5959..e3146708b 100644 --- a/src/core/proto/date.js +++ b/src/core/proto/date.js @@ -182,6 +182,20 @@ Date.prototype.getQuarterStartMonth = function () { } return quarterStartMonth; }; + +//指定日期n个月之前或之后的日期 +Date.prototype.getOffsetMonth = function (n) { + var dt = new Date(this.getTime()); + var day = dt.getDate(); + var monthDay = new Date(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays(); + if(day > monthDay){ + day = monthDay; + } + dt.setDate(day); + dt.setMonth(dt.getMonth() + parseInt(n)); + return dt; +}; + //获得本季度的起始日期 Date.prototype.getQuarterStartDate = function () { return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);