windy 8 years ago
parent
commit
69d7a87f1b
  1. 13
      bi/core.js
  2. 13
      docs/core.js
  3. 13
      src/core/proto/date.js

13
bi/core.js

@ -6388,6 +6388,19 @@ Date.prototype.getOffsetMonth = function (n) {
return dt;
};
//获得本周的起始日期
Date.prototype.getWeekStartDate = function () {
var w = this.getDay();
var offset = (w === 0 ? 7 : w);
return this.getOffsetDate(1 - offset);
};
//得到本周的结束日期
Date.prototype.getWeekEndDate = function () {
var w = this.getDay();
var offset = (w === 0 ? 0 : 7 - w);
return this.getOffsetDate(offset);
};
//获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);

13
docs/core.js

@ -23868,6 +23868,19 @@ Date.prototype.getOffsetMonth = function (n) {
return dt;
};
//获得本周的起始日期
Date.prototype.getWeekStartDate = function () {
var w = this.getDay();
var offset = (w === 0 ? 7 : w);
return this.getOffsetDate(1 - offset);
};
//得到本周的结束日期
Date.prototype.getWeekEndDate = function () {
var w = this.getDay();
var offset = (w === 0 ? 0 : 7 - w);
return this.getOffsetDate(offset);
};
//获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);

13
src/core/proto/date.js

@ -196,6 +196,19 @@ Date.prototype.getOffsetMonth = function (n) {
return dt;
};
//获得本周的起始日期
Date.prototype.getWeekStartDate = function () {
var w = this.getDay();
var offset = (w === 0 ? 7 : w);
return this.getOffsetDate(1 - offset);
};
//得到本周的结束日期
Date.prototype.getWeekEndDate = function () {
var w = this.getDay();
var offset = (w === 0 ? 0 : 7 - w);
return this.getOffsetDate(offset);
};
//获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);

Loading…
Cancel
Save