I am creating a planner and I included a gantt chart in it. My problem is I am trying to create a schedule that start in March 31, 2016 and it will ends in April 15, 2016. But my problem is my graph doesn’t display the next month.
My process is, by default my graph will load the current month with its first and last day and displayed by days.
Here’s my sample code:
[code]//get first and last day of current month
var parsed = Date.parse(“today”);
var firstOfMonth = new Date(parsed.getFullYear(),parsed.getMonth(), 1);
var lastOfMonth = new Date(parsed.getFullYear(),parsed.getMonth()+1, 0);
var f_firstOfMonth = firstOfMonth.toString(“yyyy-MM-dd”);
var f_lastOfMonth = lastOfMonth.toString(“yyyy-MM-dd”);
//assign to the empty gantt
$(".mygantt").dhx_gantt({
data: ‘’,
start_date: f_firstOfMonth,
end_date: f_lastOfMonth,
scale_height: 50,
scale_unit: “day”,
});[/code]
config.end_date has no effect if you don’t set config.start_date.
Here is an example how to repaint the displayed time range on the scale after changing the event by dnd or by the lightbox: docs.dhtmlx.com/gantt/snippet/c3962d18