Fixed get week of year function. It was broken before with a Document write call and outputted a double instead of integer.

This commit is contained in:
James Holland 2014-04-04 16:37:29 -06:00
parent 0f8c1042ad
commit 932c11f561

View File

@ -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();