Project

General

Profile

Defect #4857 ยป calender.patch

Holger Just, 2010-02-17 12:57

View differences:

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
    (1-1/1)