Defect #4857 ยป calender.patch
public/javascripts/calendar/calendar.js (working copy) | ||
---|---|---|
1698 | 1698 |
Date.prototype.getWeekNumber = function() { |
1699 | 1699 |
var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); |
1700 | 1700 |
var DoW = d.getDay(); |
1701 |
d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu
|
|
1701 |
d.setDate(d.getDate() - DoW % 7 + 4); // This weeks Thu
|
|
1702 | 1702 |
var ms = d.valueOf(); // GMT |
1703 | 1703 |
d.setMonth(0); |
1704 | 1704 |
d.setDate(4); // Thu in Week 1 |