duration step

Hello to all my friends :slight_smile:

I have a problem (Really ? :laughing: )
I’m using dhtmlx gantt and i want to do a 15min duration’s step
There is my code :
gantt.config.scale_unit = “hour”;
gantt.config.step = 1;
gantt.config.date_scale = “%H : 00”;
gantt.config.min_column_width = 33;
gantt.config.duration_unit = “minute”;
gantt.config.duration_step = 15;
gantt.config.scale_height = 70;

With this one, i’m normally able to move( resize and drag) my task every for 15 min.

But the problem is this one :
I have a task with the duration 1hour.
when i’m moving this task by resizing it on the left, newDuration = 15min
When i’m trying to give the duration 30min, it don’t work
when i’m trying to give the duration 45min, it don’t work,
when i’m trying to give the duration 1h, it work

how can i solve it ?

:confused:

Hi,
by default task dates are rounded to the time scale after drag and drop.
So you’ll need to disable this option:
docs.dhtmlx.com/gantt/api__gantt … onfig.html
And also set the global time step to 15 mins:
docs.dhtmlx.com/gantt/api__gantt … onfig.html

After you do that, all should work as expected, here is a demo:
docs.dhtmlx.com/gantt/snippet/5a798e4c

HElloo good morning,

thanks for reply,
it’s exactely the same problem :confused:
because when i trying to have a task’s duration= 30min, it’s impossible to get it.

Sincerelly

Hi,
doesn’t the snippet in my previous reply above solves the issue?
If it’s not - please provide some kind of demo where I could check what’s wrong. You can use this snippet as a basis docs.dhtmlx.com/gantt/snippet/5a798e4c - do required changes and press ‘Share’ to generate a link to your version