Why can the end_date time end at 16:00?


https://snippet.dhtmlx.com/wge2ni50
I drag task,the end_date time end at 16:00.
Why can the end_date time end at 16:00?

Then, when my duration_unit=‘‘day’,gantt.setWorkTime({ hours: [“9:00-17:00”] }).How to fill the cells?

Hello,
You have set the time step to 8 hours ( gantt.config.time_step = 60*8 ), and date correction is activated ( gantt.config.correct_work_time = true ). The working hours are set from 8:00 to 12:00 and from 13:00 to 17:00, so when you try to move a task, considering these settings, it shifts to the nearest possible time.

I’ve temporarily disabled some settings in your example; please take a look: DHTMLX Snippet Tool

Hello, when my duration_unit=‘‘day’,gantt.setWorkTime({ hours: [“9:00-17:00”] }).How to fill the cells?

Hello,
I’ve temporarily disabled some settings in your example; please take a look:
https://snippet.dhtmlx.com/tgjkuex1

  1. When I drag, I want to set his drag to only drag in multiples of 0.5 working time.
    My working hours are eight hours a day.
    Why can’t I set time step = 60*4?

2.When I resize, I want to only resize in multiples of 4.

I did this:

gantt.setWorkTime({ hours: [“9:00-17:00”] });
gantt.config.duration_unit = “hour”;
gantt.config.min_duration = 460601000;
gantt.config.duration_step = 1;
gantt.config.time_step = 60
4;
gantt.config.round_dnd_dates = false;

But it looks like none of those configurations took effect

  1. Duration can be set to a number less than 4.
  2. It will still be dragged until 16:00

@Maksim_Lakatkou @ramil

Hello,

I drag task,the end_date time end at 16:00.
Why can the end_date time end at 16:00?

It seems you encountered a bug with the skip_off_time config. When a task starts and ends in the scale borders, the task bar width is not displayed correctly.
The following snippet demonstrates that:
https://snippet.dhtmlx.com/m6qitjpi

The dev team will fix the bug in the future, but I cannot give you any ETA.
As a workaround, you can Generate this kind of scale:

08:00|17:01|08:00|17:01

and hide the non-working cells:
https://snippet.dhtmlx.com/3iwnps8r

And this is how it works in your snippet:
https://snippet.dhtmlx.com/hgfq2vtp


when my duration_unit=‘‘day’,gantt.setWorkTime({ hours: [“9:00-17:00”] }).How to fill the cells?

If you change the working time settings, you need to implement the custom scale again depending on the working time settings.


I’ve temporarily disabled some settings in your example; please take a look:
DHTMLX Snippet Tool
When I drag, I want to set his drag to only drag in multiples of 0.5 working time.
My working hours are eight hours a day.
Why can’t I set time step = 60*4?
2.When I resize, I want to only resize in multiples of 4.

When the step is 4 hours, it means the task can only start at these hours:

0,4,8,12,16,20,24

As you set the working time to start from 9, it means that only 12 and 16 are allowed hours for the task to start.
If I resize a task, I see that the duration after resize is linked to the 4-step values, like 4,8,12,16,20,24, etc.

Probably, in your case, it is better to manually modify the task dates after drag:

The following example of the implementation in the snippet can help you to start implementing your solution:
https://snippet.dhtmlx.com/zhdauxze

And this is how it will work in the previous snippet:
https://snippet.dhtmlx.com/ts35l62i