From 783906fa1030d1c8881d48d8c0d7f01355c6d3fe Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 10 May 2017 18:36:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A5=E5=91=A8=E6=97=A5=E4=B8=BA=E4=B8=80?= =?UTF-8?q?=E5=91=A8=E7=AC=AC=E4=B8=80=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bi/core.js | 5 ++--- docs/core.js | 5 ++--- src/core/proto/date.js | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/bi/core.js b/bi/core.js index 0ea460553..02207954f 100644 --- a/bi/core.js +++ b/bi/core.js @@ -6392,13 +6392,12 @@ Date.prototype.getOffsetMonth = function (n) { //获得本周的起始日期 Date.prototype.getWeekStartDate = function () { var w = this.getDay(); - var offset = (w === 0 ? 7 : w); - return this.getOffsetDate(1 - offset); + return this.getOffsetDate(-w); }; //得到本周的结束日期 Date.prototype.getWeekEndDate = function () { var w = this.getDay(); - var offset = (w === 0 ? 0 : 7 - w); + var offset = (w === 0 ? 6 : 6 - w); return this.getOffsetDate(offset); }; diff --git a/docs/core.js b/docs/core.js index bb99b48a9..746c61efe 100644 --- a/docs/core.js +++ b/docs/core.js @@ -23875,13 +23875,12 @@ Date.prototype.getOffsetMonth = function (n) { //获得本周的起始日期 Date.prototype.getWeekStartDate = function () { var w = this.getDay(); - var offset = (w === 0 ? 7 : w); - return this.getOffsetDate(1 - offset); + return this.getOffsetDate(-w); }; //得到本周的结束日期 Date.prototype.getWeekEndDate = function () { var w = this.getDay(); - var offset = (w === 0 ? 0 : 7 - w); + var offset = (w === 0 ? 6 : 6 - w); return this.getOffsetDate(offset); }; diff --git a/src/core/proto/date.js b/src/core/proto/date.js index f105cae42..b25c92d15 100644 --- a/src/core/proto/date.js +++ b/src/core/proto/date.js @@ -199,13 +199,12 @@ Date.prototype.getOffsetMonth = function (n) { //获得本周的起始日期 Date.prototype.getWeekStartDate = function () { var w = this.getDay(); - var offset = (w === 0 ? 7 : w); - return this.getOffsetDate(1 - offset); + return this.getOffsetDate(-w); }; //得到本周的结束日期 Date.prototype.getWeekEndDate = function () { var w = this.getDay(); - var offset = (w === 0 ? 0 : 7 - w); + var offset = (w === 0 ? 6 : 6 - w); return this.getOffsetDate(offset); };