diff --git a/source/Ox/js/Date.js b/source/Ox/js/Date.js index 7edddafb..70c246c0 100644 --- a/source/Ox/js/Date.js +++ b/source/Ox/js/Date.js @@ -50,12 +50,11 @@ Ox.getDayOfTheYear Get the day of the year for a given date > Ox.getDayOfTheYear(new Date("12/31/2004")) 366 @*/ - Ox.getDayOfTheYear = function(date, utc) { date = Ox.makeDate(date); var month = Ox.getMonth(date, utc), year = Ox.getFullYear(date, utc); - return Ox.sum(Ox.map(Ox.range(month), function(i) { + return Ox.sum(Ox.range(month).map(function(i) { return Ox.getDaysInMonth(year, i + 1); })) + Ox.getDate(date, utc); }; @@ -69,7 +68,7 @@ Ox.getDaysInMonth Get the number of days in a given month > Ox.getDaysInMonth(new Date('01/01/2004'), "February") 29 @*/ -Ox.getDaysInMonth = function(year, month, utc) { +Ox.getDaysInMonth = function(year, month) { year = Ox.makeYear(year); month = Ox.isNumber(month) ? month : Ox.map(Ox.MONTHS, function(v, i) {