> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Disable Date Rounding on Drag

> Configure Nextedy GANTT to stop rounding task dates to the nearest scale boundary when dragging task bars, giving you precise control over task positioning.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

## Default Behavior

By default, when you drag a task bar on the Gantt chart, the start and end dates snap to the nearest scale marks. The rounding unit depends on your current time scale:

| Scale       | Rounding Unit |
| ----------- | ------------- |
| Day (D, DD) | Full days     |
| Week (W)    | Full weeks    |
| Month (M)   | Full months   |
| Year (Y)    | Full years    |

For example, if you set the scale to **Month**, dragging a task rounds its start date and duration to full months. This behavior simplifies scheduling at coarse granularity but prevents precise date placement when needed.

## Disable Date Rounding

To disable rounding, add the following line to **Widget Properties > Advanced > Gantt Config Script**:

```javascript theme={null}
gantt.config.round_dnd_dates = false;
```

After this change, dragging task bars places them at the exact position where you drop them, without snapping to scale boundaries.

<Tip title="Combine with hour-precision scheduling">
  If you are using [hour-precision scheduling](/gantt/guides/scheduling/hour-precision) with the scale set to hours (H), disabling date rounding lets you position tasks at specific times within the day rather than snapping to whole-hour boundaries.
</Tip>

## When to Keep Rounding Enabled

Date rounding is useful in scenarios where approximate scheduling is sufficient:

* **Long-term portfolio planning** at the month or year scale, where exact days do not matter
* **Sprint planning** at the week scale, where tasks should align to sprint boundaries
* **Release planning** where milestones align to month boundaries

<Warning title="Rounding affects both drag and resize">
  The `round_dnd_dates` setting controls rounding for both drag (move) and resize operations. Setting it to `false` disables rounding for all drag-and-drop interactions.
</Warning>

## Verification

You should now see:

* Task bars placed at the exact drop position when dragged, without snapping to scale boundaries
* Dates in the lightbox reflecting the precise position where the task was dropped
* Resized task bars ending at the exact cursor position rather than the nearest scale mark

## See Also

* [Schedule in Hours Instead of Days](/gantt/guides/scheduling/hour-precision)
* [Configure the Time Scale](/gantt/guides/visualization/timescale)
* [Configure Auto-Scheduling](/gantt/guides/scheduling/configure-auto-scheduling)

<LastReviewed date="2026-07-02" />
