Is it possible to configure the week numbering in calendar?

Added by Christopher Monk over 13 years ago

For whatever reason the week numbering in the calendar doesn't match the week numbering convention that we use in our company.

I was wondering whethwer it is possible to change or reconfigure this at all?

Week number 23 in redmine is week number 24 in our company calendar.

Replies (2)

RE: Is it possible to configure the week numbering in calendar? - Added by Christopher Monk about 13 years ago

I tried editing part of the calendar.js file, thus;

/** Returns the number of the week in year, as defined in ISO 8601. */
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
    var ms = d.valueOf(); // GMT
    d.setMonth(0);
    d.setDate(4); // Thu in Week 1
/**    return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1; */
    return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 2;

This doesn't appear to have done anything, but I suspect i am close to finding the solution.

RE: Is it possible to configure the week numbering in calendar? - Added by Christopher Monk about 13 years ago

Yes!! it works....

It seemed to start working when you create new issues.

(1-2/2)