Hello Petr,
Unfortunately, there is no way to make the time_step config to work differently for different tasks. You need to implement a custom solution by using the Gantt API and Javascript.
First of all, the value of the time step is specified in minutes:
https://docs.dhtmlx.com/gantt/api__gantt_time_step_config.html#:~:text=task's%20time%20values-,number,-time_step%3B
By default, when you drag the tasks, Gantt snaps them to the start of the timeline cell. If you disable the round_dnd_dates config, Gantt will snap the dragged tasks to the start of the nearest hour. And if you set 1, Gantt will snap it to the nearest minute:
https://snippet.dhtmlx.com/bd7ir3w7
If you want to snap some tasks to the start of the day and other tasks to the start of the minute, you can set the time_step config to 1, then round the task dates manually with the roundDate method in the onAfterTaskDrag event handler:
https://docs.dhtmlx.com/gantt/api__gantt_rounddate.html
https://docs.dhtmlx.com/gantt/api__gantt_onaftertaskdrag_event.html
Here is an example of how it can be implemented:
https://snippet.dhtmlx.com/ywupk1rr
The way you want it to work with auto-scheduling contradicts with how Gantt calculates the dates when auto-scheduling tasks. The 2025-05-10 date for Gantt means 2025-05-10 00:00. So, without the lag parameter, you want the successor task (Task 2) to start earlier than its predecessor ends:
Task 1 2025-05-01 14:00:00 - 2025-05-10 14:00:00
Task 2 2025-05-10 00:00:00 - 2025-05-12 00:00:00
Gantt won’t work that way, and it is not related to the time_step parameter. Also, if it worked the way you suggest, Gantt would make it this way:
Task 1 2025-05-01 14:00:00 - 2025-05-10 14:00:00
Task 2 2025-05-11 00:00:00 - 2025-05-13 00:00:00
It is because the end date of the predecessor task ends after 12:00, so the rounded date should be the next day.
So, it is not supposed to work that way in Gantt. In theory, it should be possible to implement that if you use the "hour" value for the duration_unit parameter. But you need to implement a custom logic to set the lag value for the links. And there are no ready examples of the implementation.