Hi,
I’m dynamically creating a XML file which I forward to the dhtmlxGantt chart API:
<projects>
<project id="1" name="lalala" startdate="2012,08,20">
<task id="1">
<name>Start</name>
<est>2012,08,26</est>
<duration>32</duration>
<percentcompleted>100</percentcompleted>
<predecessortasks></predecessortasks>
</task>
<task id="2">
<name>Test</name>
<est>2012,08,24</est>
<duration>32</duration>
<percentcompleted>100</percentcompleted>
<predecessortasks></predecessortasks>
</task>
<task id="3">
<name>Blurb</name>
<est>2012,08,28</est>
<duration>32</duration>
<percentcompleted>100</percentcompleted>
<predecessortasks>2</predecessortasks>
</task>
</project>
</projects>
I’m aware that JavaScripts Date() implementation uses weird indexing for months. However, I think that’s not too relevant since in my problem year AND month are wrongly displayed when rendering. For the record, I convert my dates from
- 28-08-2012 to
- Tue Aug 28 00:08:00 CEST 2012 (GWT Date) to
- 2012,08,28 as described in the dhtmlxGantt API
I get the following result:
As you can see, the date line is totally wrong compared to the dates specified in my XML-file.
I create my chart with the following method (its Java code with Inline Javascript using JSNI):
[code]public static native JavaScriptObject initGantt(String xml) /*-{
var gantt = new $wnd.GanttChart();
gantt.setImagePath(“resources/dhtmlxGantt/imgs/”);
gantt.showNewProject(false);
gantt.setEditable(false);
gantt.create(“GanttDiv”);
if(xml != "") {
gantt.loadData(xml, false, false);
}
return gantt;
}-*/;[/code]