Skip to content

Dragging single-day task in year view shows NaN and breaks date calculation #4766

@yanmariomenev

Description

@yanmariomenev

Description

In the Gantt chart year view, a task that starts and ends on the same calendar day but spans the full day (for example, start: Mon Jul 21 2025 00:00:00 GMT+0200, end: Mon Jul 21 2025 23:59:59 GMT+0200) is not treated as a milestone, which is intended.

When dragging the start or end of this task, the drag interaction appears normal, but the date calculation fails. The tooltip shows NaN for the start or end date. Also throws the following error "Error: Maximum call stack size exceeded".

The issue occurs in the get taskWidth() function, where the calculation:

(taskEnd.getDate() - taskStart.getDate()) / totalDaysInStartMonth

Steps To Reproduce

https://stackblitz.com/edit/angular-fjr9prry-3bxhfvg1
or
https://stackblitz.com/edit/angular-fjr9prry-ykfgqtng

Screenshots or video

GanttDragSingleDay.mp4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions