mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
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:
parent
0f8c1042ad
commit
932c11f561
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user