Custom DnD Date rounding

Currently when I am on the day scale with step 1 and I drag a task and drop it near a date line it always snaps backwards

I want to snap to the nearest day line not always the previous day line

eg.

Dropping the task 1pixel behind the 15th April results in the date snapping to the 14th April
Dropping the task 1pixel in front of the 15th of April results in the date snapping to the 14th April

Expected result closest date before or after gets snaped to not only the closest previous date

Can I add my own custom snap calculation?

Where do I get the DnD time stamp from right now all I get is the date.

Hi,
If you drag task by 1px near the border (prntscr.com/ixzirv) in either direction, event should return on the position before dragging.

Can I add my own custom snap calculation?
There is no easy way to do it, just by changing the source code.

Where do I get the DnD time stamp from right now all I get is the date.
For example in event onTaskDrag. Check task.start_date value in console:
docs.dhtmlx.com/gantt/snippet/47365733

So I managed to achieve what I wanted by changing the date format for days from ‘%F’ -> ‘%j %M %F’

This gave me the time I needed in the tasks start_date & end_date to perform the custom snapping.

Then in onAfterTaskDrag event handler I modify the date if date.getHours() >= 12 I add 1 day

Now it snaps to the closest date line

Problem solved!