diff --git a/date-functions.js b/date-functions.js index 611ed08..1f8e0ea 100644 --- a/date-functions.js +++ b/date-functions.js @@ -310,8 +310,7 @@ Date.prototype.getWeekOfYear = function () { var now = this.getDayOfYear() + (4 - this.getDay()); var jan1 = new Date(this.getFullYear(), 0, 1); var then = (7 - jan1.getDay() + 4); - document.write(then); - return String.leftPad(((now - then) / 7) + 1, 2, "0") + return String.leftPad(Math.ceil((now - then) / 7) + 1, 2, "0") }; Date.prototype.isLeapYear = function () { var year = this.getFullYear();