Fixed the getDayOfYear function to start at 1 instead of 0.

This commit is contained in:
James Holland 2014-04-04 16:14:25 -06:00
parent 3f12daa372
commit 0f8c1042ad

View File

@ -304,7 +304,7 @@ Date.prototype.getDayOfYear = function () {
for (var i = 0; i < this.getMonth(); ++i) { for (var i = 0; i < this.getMonth(); ++i) {
num += Date.daysInMonth[i] num += Date.daysInMonth[i]
} }
return num + this.getDate() - 1 return num + this.getDate()
}; };
Date.prototype.getWeekOfYear = function () { Date.prototype.getWeekOfYear = function () {
var now = this.getDayOfYear() + (4 - this.getDay()); var now = this.getDayOfYear() + (4 - this.getDay());
@ -388,4 +388,4 @@ Date.patterns = {
SortableDateTimePattern: "Y-m-d\\TH:i:s", SortableDateTimePattern: "Y-m-d\\TH:i:s",
UniversalSortableDateTimePattern: "Y-m-d H:i:sO", UniversalSortableDateTimePattern: "Y-m-d H:i:sO",
YearMonthPattern: "F, Y" YearMonthPattern: "F, Y"
}; };