I am new to jQuery and have tried to modify the existing Gantt chart plugins so as to get a chart with months but not days but to no avail. Can somebody please help me in converting the three dimensional date array into a two dimensional one consisting of just the month and the year (as I guess that this might be a solution to this problem)? If I'm wrong about the solution then please provide me with one. Thank you in advance.
// Creates a 3 dimensional array [year][month][day] of every day
// between the given start and end dates
function getDates(start, end) {
var dates = [];
dates[start.getFullYear()] = [];
dates[start.getFullYear()][start.getMonth()] = [start]
var last = start;
while (last.compareTo(end) == -1) {
var next = last.clone().addDays(1);
if (!dates[next.getFullYear()]) { dates[next.getFullYear()] = []; }
if (!dates[next.getFullYear()][next.getMonth()]) {
dates[next.getFullYear()][next.getMonth()] = [];
}
dates[next.getFullYear()][next.getMonth()].push(next);
last = next;
}
return dates;
}
I know of three excellent commercial libraries for creating Gantt charts of varying levels of complexity. None of them require jQuery per se, but they can be used alongside it. In order of simplest to most complex: