It is currently starting based on week of the year and I am trying to start my week count from a date I specify.
For example: instead of starting at week 45 calculated from the first of the year. I want to start from week 1 with
a custom start date.. like from today.. week 1, 2 ,3 etc..
Does any one of a way to customize the weeks this way ?
Here is the current code for Gantt Chart Week calculations:
Code: Select all
W: function () {
var target = new Date(this.valueOf())
var dayNr = (this.getDay() + 6) % 7
target.setDate(target.getDate() - dayNr + 3)
var firstThursday = target.valueOf()
target.setMonth(0, 1)
if (target.getDay() !== 4) {
target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7)
}
var retVal = 1 + Math.ceil((firstThursday - target) / 604800000)
return (retVal < 10 ? '0' + retVal : retVal)
},