From 086cf229bb7de76df0f614141aefcc1342d4d9b1 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 23 Mar 2018 16:06:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E9=83=A8=E5=88=86=E6=9C=88?= =?UTF-8?q?=E4=BB=BD=E5=8F=96=E5=80=BC=E4=B8=BA1-12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/widget/date/demo.datepane.js | 6 +-- demo/js/widget/date/demo.multidate_combo.js | 4 +- .../widget/yearmonth/demo.year_month_combo.js | 6 +-- .../demo.year_month_interval.js | 2 +- dist/bundle.js | 39 +++++++++++-------- dist/case.js | 9 ++++- dist/demo.js | 18 ++++----- dist/widget.js | 30 +++++++------- src/case/calendar/calendar.js | 9 ++++- src/widget/date/calendar/combo.month.date.js | 2 +- src/widget/date/calendar/picker.date.js | 6 +-- src/widget/dynamicdate/dynamicdate.popup.js | 2 +- src/widget/dynamicdate/dynamicdate.trigger.js | 4 +- .../dynamicdatetime/dynamicdatetime.popup.js | 2 +- .../dynamicdatetime.trigger.js | 4 +- src/widget/month/popup.month.js | 4 +- src/widget/yearmonth/card.static.yearmonth.js | 4 +- src/widget/yearmonth/trigger.yearmonth.js | 2 +- 18 files changed, 84 insertions(+), 69 deletions(-) diff --git a/demo/js/widget/date/demo.datepane.js b/demo/js/widget/date/demo.datepane.js index 5f687de49..025026a1d 100644 --- a/demo/js/widget/date/demo.datepane.js +++ b/demo/js/widget/date/demo.datepane.js @@ -19,7 +19,7 @@ Demo.DatePane = BI.inherit(BI.Widget, { type: 1, value: { year: 2017, - month: 11, + month: 12, day: 11 } }, @@ -39,7 +39,7 @@ Demo.DatePane = BI.inherit(BI.Widget, { type: 1, value: { year: 2017, - month: 11, + month: 12, day: 11, hour: 12, minute: 12, @@ -62,7 +62,7 @@ Demo.DatePane = BI.inherit(BI.Widget, { handler: function () { self.datepane.setValue({ year: 2017, - month: 11, + month: 12, day: 31 }); } diff --git a/demo/js/widget/date/demo.multidate_combo.js b/demo/js/widget/date/demo.multidate_combo.js index 0177e32f8..7573a4f6b 100644 --- a/demo/js/widget/date/demo.multidate_combo.js +++ b/demo/js/widget/date/demo.multidate_combo.js @@ -25,7 +25,7 @@ Demo.Date = BI.inherit(BI.Widget, { type: 1, value: { year: 2018, - month: 1, + month: 2, day: 23 } } @@ -46,7 +46,7 @@ Demo.Date = BI.inherit(BI.Widget, { type: 1, value: { year: 2018, - month: 1, + month: 2, day: 23 } } diff --git a/demo/js/widget/yearmonth/demo.year_month_combo.js b/demo/js/widget/yearmonth/demo.year_month_combo.js index b4044a590..1eafab451 100644 --- a/demo/js/widget/yearmonth/demo.year_month_combo.js +++ b/demo/js/widget/yearmonth/demo.year_month_combo.js @@ -20,7 +20,7 @@ Demo.YearMonthCombo = BI.inherit(BI.Widget, { type: 1, value: { year: 2018, - month: 0 + month: 1 } } }, { @@ -32,12 +32,12 @@ Demo.YearMonthCombo = BI.inherit(BI.Widget, { width: 300 }, { type: "bi.button", - text: "setVlaue '2017-12'", + text: "setValue '2017-12'", width: 300, handler: function () { self.widget.setValue({ year: 2017, - month: 11 + month: 12 }); } }], diff --git a/demo/js/widget/yearmonthinterval/demo.year_month_interval.js b/demo/js/widget/yearmonthinterval/demo.year_month_interval.js index a87de534c..b0958b50d 100644 --- a/demo/js/widget/yearmonthinterval/demo.year_month_interval.js +++ b/demo/js/widget/yearmonthinterval/demo.year_month_interval.js @@ -24,7 +24,7 @@ Demo.YearMonthInterval = BI.inherit(BI.Widget, { type: 1, value: { year: 2018, - month: 0 + month: 1 } } }, diff --git a/dist/bundle.js b/dist/bundle.js index 94a8ad78e..4252e40de 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -73547,7 +73547,7 @@ BI.Calendar = BI.inherit(BI.Widget, { min: "1900-01-01", // 最小日期 max: "2099-12-31", // 最大日期 year: 2015, - month: 7, // 7表示八月 + month: 8, day: 25 }); }, @@ -73565,18 +73565,23 @@ BI.Calendar = BI.inherit(BI.Widget, { var MD = Date._MD.slice(0); MD[1] = BI.isLeapYear(log.ymd[0]) ? 29 : 28; + // 日期所在月第一天 De.setFullYear(log.ymd[0], log.ymd[1], 1); + // 是周几 log.FDay = De.getDay(); + // 当前月页第一天是几号 log.PDay = MD[M === 0 ? 11 : M - 1] - log.FDay + 1; log.NDay = 1; var items = []; BI.each(BI.range(42), function (i) { var td = {}, YY = log.ymd[0], MM = log.ymd[1] + 1, DD; + // 上个月的日期 if (i < log.FDay) { td.lastMonth = true; DD = i + log.PDay; + // 上一年 MM === 1 && (YY -= 1); MM = MM === 1 ? 12 : MM - 1; } else if (i >= log.FDay && i < log.FDay + MD[log.ymd[1]]) { @@ -73619,7 +73624,7 @@ BI.Calendar = BI.inherit(BI.Widget, { vgap: 10 }] }); - var days = this._dateCreator(o.year, o.month, o.day); + var days = this._dateCreator(o.year, o.month - 1, o.day); items = []; items.push(days.slice(0, 7)); items.push(days.slice(7, 14)); @@ -86943,7 +86948,7 @@ BI.MonthDateCombo = BI.inherit(BI.Trigger, { }, setValue: function (v) { - this.trigger.setValue(v + 1); + this.trigger.setValue(v); this.popup.setValue(v); }, @@ -87048,7 +87053,7 @@ BI.DatePicker = BI.inherit(BI.Widget, { if (self._month === 0) { self.setValue({ year: self.year.getValue() - 1, - month: 11 + month: 12 }); } else { self.setValue({ @@ -87140,14 +87145,14 @@ BI.DatePicker = BI.inherit(BI.Widget, { _checkLeftValid: function () { var o = this.options; - var valid = !(this._month === 0 && this._year === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear()); + var valid = !(this._month === 1 && this._year === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear()); this.left.setEnable(valid); return valid; }, _checkRightValid: function () { var o = this.options; - var valid = !(this._month === 11 && this._year === BI.parseDateTime(o.max, "%Y-%X-%d").getFullYear()); + var valid = !(this._month === 12 && this._year === BI.parseDateTime(o.max, "%Y-%X-%d").getFullYear()); this.right.setEnable(valid); return valid; }, @@ -90452,7 +90457,7 @@ BI.shortcut("bi.dynamic_date_param_item", BI.DynamicDateParamItem);BI.DynamicDat var date = BI.getDate(); this.ymd.setValue({ year: date.getFullYear(), - month: date.getMonth(), + month: date.getMonth() + 1, day: date.getDate() }); this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")); @@ -90547,7 +90552,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger type: BI.DynamicDateCombo.Static, value: { year: date[0] | 0, - month: date[1] - 1, + month: date[1], day: date[2] | 0 } }; @@ -90676,7 +90681,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger this.editor.setValue(""); this.setTitle(""); } else { - var dateStr = value.year + "-" + (value.month + 1) + "-" + value.day; + var dateStr = value.year + "-" + (value.month) + "-" + value.day; this.editor.setState(dateStr); this.editor.setValue(dateStr); this.setTitle(dateStr); @@ -91166,7 +91171,7 @@ BI.extend(BI.DynamicDateTimeCombo, { var date = BI.getDate(); this.ymd.setValue({ year: date.getFullYear(), - month: date.getMonth(), + month: date.getMonth() + 1, day: date.getDate() }); this.timeSelect.setValue(); @@ -91431,7 +91436,7 @@ BI.extend(BI.DynamicDateTimeSelect, { type: BI.DynamicDateCombo.Static, value: { year: date[0] | 0, - month: date[1] - 1, + month: date[1], day: date[2] | 0, hour: date[3] | 0, minute: date[4] | 0, @@ -91563,7 +91568,7 @@ BI.extend(BI.DynamicDateTimeSelect, { this.editor.setValue(""); this.setTitle(""); } else { - var dateStr = value.year + "-" + (value.month + 1) + "-" + value.day + " " + + var dateStr = value.year + "-" + (value.month) + "-" + value.day + " " + (value.hour || "00") + ":" + (value.minute || "00") + ":" + (value.second || "00"); this.editor.setState(dateStr); this.editor.setValue(dateStr); @@ -93499,7 +93504,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { var self = this, o = this.options; // 纵向排列月 - var month = [0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11]; + var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; items.push(month.slice(0, 2)); items.push(month.slice(2, 4)); @@ -93519,7 +93524,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { height: 23, width: 38, value: td, - text: td + 1 + text: td }; }); }); @@ -106840,7 +106845,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear _createMonths: function () { // 纵向排列月 - var month = [0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11]; + var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; items.push(month.slice(0, 2)); items.push(month.slice(2, 4)); @@ -106860,7 +106865,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear height: 23, width: 38, value: td, - text: td + 1 + text: td }; }); }); @@ -107502,7 +107507,7 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY case BI.DynamicDateCombo.Static: default: value = value || {}; - var month = BI.isNull(value.month) ? null : value.month + 1; + var month = BI.isNull(value.month) ? null : value.month; this.yearEditor.setValue(value.year); this.yearEditor.setTitle(value.year); this.monthEditor.setValue(month); diff --git a/dist/case.js b/dist/case.js index 46f730ccf..5582e2b01 100644 --- a/dist/case.js +++ b/dist/case.js @@ -1605,7 +1605,7 @@ BI.Calendar = BI.inherit(BI.Widget, { min: "1900-01-01", // 最小日期 max: "2099-12-31", // 最大日期 year: 2015, - month: 7, // 7表示八月 + month: 8, day: 25 }); }, @@ -1623,18 +1623,23 @@ BI.Calendar = BI.inherit(BI.Widget, { var MD = Date._MD.slice(0); MD[1] = BI.isLeapYear(log.ymd[0]) ? 29 : 28; + // 日期所在月第一天 De.setFullYear(log.ymd[0], log.ymd[1], 1); + // 是周几 log.FDay = De.getDay(); + // 当前月页第一天是几号 log.PDay = MD[M === 0 ? 11 : M - 1] - log.FDay + 1; log.NDay = 1; var items = []; BI.each(BI.range(42), function (i) { var td = {}, YY = log.ymd[0], MM = log.ymd[1] + 1, DD; + // 上个月的日期 if (i < log.FDay) { td.lastMonth = true; DD = i + log.PDay; + // 上一年 MM === 1 && (YY -= 1); MM = MM === 1 ? 12 : MM - 1; } else if (i >= log.FDay && i < log.FDay + MD[log.ymd[1]]) { @@ -1677,7 +1682,7 @@ BI.Calendar = BI.inherit(BI.Widget, { vgap: 10 }] }); - var days = this._dateCreator(o.year, o.month, o.day); + var days = this._dateCreator(o.year, o.month - 1, o.day); items = []; items.push(days.slice(0, 7)); items.push(days.slice(7, 14)); diff --git a/dist/demo.js b/dist/demo.js index bde246c51..5f3ec7afb 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -12097,7 +12097,7 @@ BI.shortcut("demo.tips", Demo.Tips);Demo.DatePane = BI.inherit(BI.Widget, { type: 1, value: { year: 2017, - month: 11, + month: 12, day: 11 } }, @@ -12117,7 +12117,7 @@ BI.shortcut("demo.tips", Demo.Tips);Demo.DatePane = BI.inherit(BI.Widget, { type: 1, value: { year: 2017, - month: 11, + month: 12, day: 11, hour: 12, minute: 12, @@ -12140,7 +12140,7 @@ BI.shortcut("demo.tips", Demo.Tips);Demo.DatePane = BI.inherit(BI.Widget, { handler: function () { self.datepane.setValue({ year: 2017, - month: 11, + month: 12, day: 31 }); } @@ -12183,7 +12183,7 @@ Demo.Date = BI.inherit(BI.Widget, { type: 1, value: { year: 2018, - month: 1, + month: 2, day: 23 } } @@ -12204,7 +12204,7 @@ Demo.Date = BI.inherit(BI.Widget, { type: 1, value: { year: 2018, - month: 1, + month: 2, day: 23 } } @@ -14557,7 +14557,7 @@ Demo.YearMonthCombo = BI.inherit(BI.Widget, { type: 1, value: { year: 2018, - month: 0 + month: 1 } } }, { @@ -14569,12 +14569,12 @@ Demo.YearMonthCombo = BI.inherit(BI.Widget, { width: 300 }, { type: "bi.button", - text: "setVlaue '2017-12'", + text: "setValue '2017-12'", width: 300, handler: function () { self.widget.setValue({ year: 2017, - month: 11 + month: 12 }); } }], @@ -14609,7 +14609,7 @@ BI.shortcut("demo.year_month_combo", Demo.YearMonthCombo);Demo.YearMonthInterval type: 1, value: { year: 2018, - month: 0 + month: 1 } } }, diff --git a/dist/widget.js b/dist/widget.js index abbacfcd2..f57e2623c 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -468,7 +468,7 @@ BI.MonthDateCombo = BI.inherit(BI.Trigger, { }, setValue: function (v) { - this.trigger.setValue(v + 1); + this.trigger.setValue(v); this.popup.setValue(v); }, @@ -573,7 +573,7 @@ BI.DatePicker = BI.inherit(BI.Widget, { if (self._month === 0) { self.setValue({ year: self.year.getValue() - 1, - month: 11 + month: 12 }); } else { self.setValue({ @@ -665,14 +665,14 @@ BI.DatePicker = BI.inherit(BI.Widget, { _checkLeftValid: function () { var o = this.options; - var valid = !(this._month === 0 && this._year === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear()); + var valid = !(this._month === 1 && this._year === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear()); this.left.setEnable(valid); return valid; }, _checkRightValid: function () { var o = this.options; - var valid = !(this._month === 11 && this._year === BI.parseDateTime(o.max, "%Y-%X-%d").getFullYear()); + var valid = !(this._month === 12 && this._year === BI.parseDateTime(o.max, "%Y-%X-%d").getFullYear()); this.right.setEnable(valid); return valid; }, @@ -3977,7 +3977,7 @@ BI.shortcut("bi.dynamic_date_param_item", BI.DynamicDateParamItem);BI.DynamicDat var date = BI.getDate(); this.ymd.setValue({ year: date.getFullYear(), - month: date.getMonth(), + month: date.getMonth() + 1, day: date.getDate() }); this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")); @@ -4072,7 +4072,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger type: BI.DynamicDateCombo.Static, value: { year: date[0] | 0, - month: date[1] - 1, + month: date[1], day: date[2] | 0 } }; @@ -4201,7 +4201,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger this.editor.setValue(""); this.setTitle(""); } else { - var dateStr = value.year + "-" + (value.month + 1) + "-" + value.day; + var dateStr = value.year + "-" + (value.month) + "-" + value.day; this.editor.setState(dateStr); this.editor.setValue(dateStr); this.setTitle(dateStr); @@ -4691,7 +4691,7 @@ BI.extend(BI.DynamicDateTimeCombo, { var date = BI.getDate(); this.ymd.setValue({ year: date.getFullYear(), - month: date.getMonth(), + month: date.getMonth() + 1, day: date.getDate() }); this.timeSelect.setValue(); @@ -4956,7 +4956,7 @@ BI.extend(BI.DynamicDateTimeSelect, { type: BI.DynamicDateCombo.Static, value: { year: date[0] | 0, - month: date[1] - 1, + month: date[1], day: date[2] | 0, hour: date[3] | 0, minute: date[4] | 0, @@ -5088,7 +5088,7 @@ BI.extend(BI.DynamicDateTimeSelect, { this.editor.setValue(""); this.setTitle(""); } else { - var dateStr = value.year + "-" + (value.month + 1) + "-" + value.day + " " + + var dateStr = value.year + "-" + (value.month) + "-" + value.day + " " + (value.hour || "00") + ":" + (value.minute || "00") + ":" + (value.second || "00"); this.editor.setState(dateStr); this.editor.setValue(dateStr); @@ -7024,7 +7024,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { var self = this, o = this.options; // 纵向排列月 - var month = [0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11]; + var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; items.push(month.slice(0, 2)); items.push(month.slice(2, 4)); @@ -7044,7 +7044,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { height: 23, width: 38, value: td, - text: td + 1 + text: td }; }); }); @@ -20365,7 +20365,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear _createMonths: function () { // 纵向排列月 - var month = [0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11]; + var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; items.push(month.slice(0, 2)); items.push(month.slice(2, 4)); @@ -20385,7 +20385,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear height: 23, width: 38, value: td, - text: td + 1 + text: td }; }); }); @@ -21027,7 +21027,7 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY case BI.DynamicDateCombo.Static: default: value = value || {}; - var month = BI.isNull(value.month) ? null : value.month + 1; + var month = BI.isNull(value.month) ? null : value.month; this.yearEditor.setValue(value.year); this.yearEditor.setTitle(value.year); this.monthEditor.setValue(month); diff --git a/src/case/calendar/calendar.js b/src/case/calendar/calendar.js index 747a3097c..f755fa4e0 100644 --- a/src/case/calendar/calendar.js +++ b/src/case/calendar/calendar.js @@ -14,7 +14,7 @@ BI.Calendar = BI.inherit(BI.Widget, { min: "1900-01-01", // 最小日期 max: "2099-12-31", // 最大日期 year: 2015, - month: 7, // 7表示八月 + month: 8, day: 25 }); }, @@ -32,18 +32,23 @@ BI.Calendar = BI.inherit(BI.Widget, { var MD = Date._MD.slice(0); MD[1] = BI.isLeapYear(log.ymd[0]) ? 29 : 28; + // 日期所在月第一天 De.setFullYear(log.ymd[0], log.ymd[1], 1); + // 是周几 log.FDay = De.getDay(); + // 当前月页第一天是几号 log.PDay = MD[M === 0 ? 11 : M - 1] - log.FDay + 1; log.NDay = 1; var items = []; BI.each(BI.range(42), function (i) { var td = {}, YY = log.ymd[0], MM = log.ymd[1] + 1, DD; + // 上个月的日期 if (i < log.FDay) { td.lastMonth = true; DD = i + log.PDay; + // 上一年 MM === 1 && (YY -= 1); MM = MM === 1 ? 12 : MM - 1; } else if (i >= log.FDay && i < log.FDay + MD[log.ymd[1]]) { @@ -86,7 +91,7 @@ BI.Calendar = BI.inherit(BI.Widget, { vgap: 10 }] }); - var days = this._dateCreator(o.year, o.month, o.day); + var days = this._dateCreator(o.year, o.month - 1, o.day); items = []; items.push(days.slice(0, 7)); items.push(days.slice(7, 14)); diff --git a/src/widget/date/calendar/combo.month.date.js b/src/widget/date/calendar/combo.month.date.js index 07466cba9..eca405f84 100644 --- a/src/widget/date/calendar/combo.month.date.js +++ b/src/widget/date/calendar/combo.month.date.js @@ -49,7 +49,7 @@ BI.MonthDateCombo = BI.inherit(BI.Trigger, { }, setValue: function (v) { - this.trigger.setValue(v + 1); + this.trigger.setValue(v); this.popup.setValue(v); }, diff --git a/src/widget/date/calendar/picker.date.js b/src/widget/date/calendar/picker.date.js index f420e8493..5268224f7 100644 --- a/src/widget/date/calendar/picker.date.js +++ b/src/widget/date/calendar/picker.date.js @@ -29,7 +29,7 @@ BI.DatePicker = BI.inherit(BI.Widget, { if (self._month === 0) { self.setValue({ year: self.year.getValue() - 1, - month: 11 + month: 12 }); } else { self.setValue({ @@ -121,14 +121,14 @@ BI.DatePicker = BI.inherit(BI.Widget, { _checkLeftValid: function () { var o = this.options; - var valid = !(this._month === 0 && this._year === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear()); + var valid = !(this._month === 1 && this._year === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear()); this.left.setEnable(valid); return valid; }, _checkRightValid: function () { var o = this.options; - var valid = !(this._month === 11 && this._year === BI.parseDateTime(o.max, "%Y-%X-%d").getFullYear()); + var valid = !(this._month === 12 && this._year === BI.parseDateTime(o.max, "%Y-%X-%d").getFullYear()); this.right.setEnable(valid); return valid; }, diff --git a/src/widget/dynamicdate/dynamicdate.popup.js b/src/widget/dynamicdate/dynamicdate.popup.js index 90ffc8003..0efc24f10 100644 --- a/src/widget/dynamicdate/dynamicdate.popup.js +++ b/src/widget/dynamicdate/dynamicdate.popup.js @@ -189,7 +189,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, { var date = BI.getDate(); this.ymd.setValue({ year: date.getFullYear(), - month: date.getMonth(), + month: date.getMonth() + 1, day: date.getDate() }); this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")); diff --git a/src/widget/dynamicdate/dynamicdate.trigger.js b/src/widget/dynamicdate/dynamicdate.trigger.js index a770148c5..c48070870 100644 --- a/src/widget/dynamicdate/dynamicdate.trigger.js +++ b/src/widget/dynamicdate/dynamicdate.trigger.js @@ -69,7 +69,7 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { type: BI.DynamicDateCombo.Static, value: { year: date[0] | 0, - month: date[1] - 1, + month: date[1], day: date[2] | 0 } }; @@ -198,7 +198,7 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { this.editor.setValue(""); this.setTitle(""); } else { - var dateStr = value.year + "-" + (value.month + 1) + "-" + value.day; + var dateStr = value.year + "-" + (value.month) + "-" + value.day; this.editor.setState(dateStr); this.editor.setValue(dateStr); this.setTitle(dateStr); diff --git a/src/widget/dynamicdatetime/dynamicdatetime.popup.js b/src/widget/dynamicdatetime/dynamicdatetime.popup.js index 340794cfb..8342ac6b8 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.popup.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.popup.js @@ -201,7 +201,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, { var date = BI.getDate(); this.ymd.setValue({ year: date.getFullYear(), - month: date.getMonth(), + month: date.getMonth() + 1, day: date.getDate() }); this.timeSelect.setValue(); diff --git a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js index b24772d56..99f76ddfc 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js @@ -69,7 +69,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { type: BI.DynamicDateCombo.Static, value: { year: date[0] | 0, - month: date[1] - 1, + month: date[1], day: date[2] | 0, hour: date[3] | 0, minute: date[4] | 0, @@ -201,7 +201,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { this.editor.setValue(""); this.setTitle(""); } else { - var dateStr = value.year + "-" + (value.month + 1) + "-" + value.day + " " + + var dateStr = value.year + "-" + (value.month) + "-" + value.day + " " + (value.hour || "00") + ":" + (value.minute || "00") + ":" + (value.second || "00"); this.editor.setState(dateStr); this.editor.setValue(dateStr); diff --git a/src/widget/month/popup.month.js b/src/widget/month/popup.month.js index 8811b65f8..2fe941bfb 100644 --- a/src/widget/month/popup.month.js +++ b/src/widget/month/popup.month.js @@ -19,7 +19,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { var self = this, o = this.options; // 纵向排列月 - var month = [0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11]; + var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; items.push(month.slice(0, 2)); items.push(month.slice(2, 4)); @@ -39,7 +39,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { height: 23, width: 38, value: td, - text: td + 1 + text: td }; }); }); diff --git a/src/widget/yearmonth/card.static.yearmonth.js b/src/widget/yearmonth/card.static.yearmonth.js index e1a6c34ce..65749d8a3 100644 --- a/src/widget/yearmonth/card.static.yearmonth.js +++ b/src/widget/yearmonth/card.static.yearmonth.js @@ -7,7 +7,7 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, { _createMonths: function () { // 纵向排列月 - var month = [0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11]; + var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; items.push(month.slice(0, 2)); items.push(month.slice(2, 4)); @@ -27,7 +27,7 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, { height: 23, width: 38, value: td, - text: td + 1 + text: td }; }); }); diff --git a/src/widget/yearmonth/trigger.yearmonth.js b/src/widget/yearmonth/trigger.yearmonth.js index 5e2e35ca8..6e0c428d6 100644 --- a/src/widget/yearmonth/trigger.yearmonth.js +++ b/src/widget/yearmonth/trigger.yearmonth.js @@ -179,7 +179,7 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { case BI.DynamicDateCombo.Static: default: value = value || {}; - var month = BI.isNull(value.month) ? null : value.month + 1; + var month = BI.isNull(value.month) ? null : value.month; this.yearEditor.setValue(value.year); this.yearEditor.setTitle(value.year); this.monthEditor.setValue(month);