guy 8 years ago
parent
commit
230d4ada4f
  1. 13
      bi/core.js
  2. 13
      docs/core.js
  3. 13
      src/core/proto/date.js

13
bi/core.js

@ -6389,6 +6389,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

@ -23872,6 +23872,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