Skip to content

Commit

Permalink
Fixed the getDayOfYear function to start at 1 instead of 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesfholland committed Apr 4, 2014
1 parent 3f12daa commit 0f8c104
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions date-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ Date.prototype.getDayOfYear = function () {
for (var i = 0; i < this.getMonth(); ++i) {
num += Date.daysInMonth[i]
}
return num + this.getDate() - 1
return num + this.getDate()
};
Date.prototype.getWeekOfYear = function () {
var now = this.getDayOfYear() + (4 - this.getDay());
Expand Down Expand Up @@ -388,4 +388,4 @@ Date.patterns = {
SortableDateTimePattern: "Y-m-d\\TH:i:s",
UniversalSortableDateTimePattern: "Y-m-d H:i:sO",
YearMonthPattern: "F, Y"
};
};

0 comments on commit 0f8c104

Please sign in to comment.