|
|
|
@ -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); |
|
|
|
|