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