Round drag and drop to days


Hi there,

I have round_dnd_dates turned on if my zoom level isset to “day”, otherwise it will be false

When I move a task in “month” zoom level, there is a big chance it will be dropped in the middle of day


Is there any way to round dropped task to start of day?


When you disable the round_dnd_dates parameter, Gantt won’t round the task to the nearest scale border. The task will have the same position where you placed it. So, it is expected behavior that the tasks don’t always start at the beginning of the day.
You need to manually round their dates with the method in the onAfterTaskDrag event handler:

Here is an example of how it might be implemented:


Thank you @ramil

I have tried so many things in onAfterTaskDrag event handler, but not that :sweat_smile: