From 3cfdcc84dd1508c3eb05efb35e8ab050800b16a8 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 20 Dec 2013 13:52:06 +0000 Subject: [PATCH] Fixed bug with getWeekId (Dec 31, 2013 would give 'dh-2013-0' instead of 'dh-2014-0') --- js/jquery.fn.gantt.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/js/jquery.fn.gantt.js b/js/jquery.fn.gantt.js index 686b420..e06a89f 100644 --- a/js/jquery.fn.gantt.js +++ b/js/jquery.fn.gantt.js @@ -106,13 +106,8 @@ // the week # for the year. // It is used to add an id to the week divs Date.prototype.getWeekId = function () { - var y = this.getFullYear(); - var w = this.getDayForWeek().getWeekOfYear(); - var m = this.getMonth(); - if (m === 11 && w === 1) { - y++; - } - return 'dh-' + y + "-" + w; + var wk = this.getDayForWeek(); + return 'dh-' + wk.getFullYear() + "-" + wk.getWeekOfYear(); }; // `getRepDate` returns the seconds since the epoch for a given date