|
|
@ -23732,7 +23732,6 @@ Date._QN = ["", BI.i18nText("BI-Quarter_1"), |
|
|
|
BI.i18nText("BI-Quarter_4")]; |
|
|
|
BI.i18nText("BI-Quarter_4")]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Adds the number of days array to the Date object. */ |
|
|
|
/** Adds the number of days array to the Date object. */ |
|
|
|
Date._MD = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; |
|
|
|
Date._MD = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; |
|
|
|
|
|
|
|
|
|
|
@ -23767,12 +23766,19 @@ Date.prototype.getDayOfYear = function () { |
|
|
|
/** Returns the number of the week in year, as defined in ISO 8601. */ |
|
|
|
/** Returns the number of the week in year, as defined in ISO 8601. */ |
|
|
|
Date.prototype.getWeekNumber = function () { |
|
|
|
Date.prototype.getWeekNumber = function () { |
|
|
|
var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); |
|
|
|
var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); |
|
|
|
var DoW = d.getDay(); |
|
|
|
var week = d.getDay(); |
|
|
|
d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu
|
|
|
|
if (this.getMonth() === 0 && this.getDate() <= week) { |
|
|
|
|
|
|
|
return 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
d.setDate(this.getDate() - week); |
|
|
|
var ms = d.valueOf(); // GMT
|
|
|
|
var ms = d.valueOf(); // GMT
|
|
|
|
d.setMonth(0); |
|
|
|
d.setMonth(0); |
|
|
|
d.setDate(4); // Thu in Week 1
|
|
|
|
d.setDate(1); |
|
|
|
return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1; |
|
|
|
var offset = Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1; |
|
|
|
|
|
|
|
if (d.getDay() > 0) { |
|
|
|
|
|
|
|
offset++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return offset; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
//离当前时间多少天的时间
|
|
|
|
//离当前时间多少天的时间
|
|
|
@ -23864,7 +23870,7 @@ Date.prototype.getOffsetMonth = function (n) { |
|
|
|
var dt = new Date(this.getTime()); |
|
|
|
var dt = new Date(this.getTime()); |
|
|
|
var day = dt.getDate(); |
|
|
|
var day = dt.getDate(); |
|
|
|
var monthDay = new Date(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays(); |
|
|
|
var monthDay = new Date(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays(); |
|
|
|
if(day > monthDay){ |
|
|
|
if (day > monthDay) { |
|
|
|
day = monthDay; |
|
|
|
day = monthDay; |
|
|
|
} |
|
|
|
} |
|
|
|
dt.setDate(day); |
|
|
|
dt.setDate(day); |
|
|
|