Possible bug when setting duration in code

Hi there,

I have a situation that I think might be due to a bug. I try to change the duration using javascript, and nothing really happens.

To exclude my own code, follow along using one of your own exemple gantts:

1. Find the task id of one of tasks (doesn’t really matter which one), using


(In my example below I pick id 5.)

2. Check what the duration currently is


outputs 4.

3. Change the duration to something else

gantt.getTask(5).duration = 10

4. Just to verify things are kind of working, also change the title

gantt.getTask(5).text = "LOLCAT"

5. And update the task, which causes a POST to the server


6. Look at the posted data


…where the relevant info is

5_duration=4 5_text=LOLCAT

Is this a known bug? Am I missing something obvious? Any possible workarounds? (Obviously I need to code the duration for this use-case so using the lightbox isn’t really an option.)

Fred S

PS. It might be valuable to note that if I update the duration using the lightbox, everything works as expected.

try setting the end_date with the duration:[code]var task = gantt.getTask(5);
task.duration = 10;
task.end_date = gantt.calculateEndDate(task.start_date, task.duration);

we’ll investigate why simple changing of the duration gets overwriten by an end_date. Maybe there is a reason for this behavior, otherwise we’ll fix it in the upcoming version

Thank you, I will try this work-around.

Fred S


Just a quick note to let you know your solution worked like a charm.

Fred S