diff --git a/components/tvplanit/source/vpganttview.pas b/components/tvplanit/source/vpganttview.pas index cf1aae703..fa068b359 100644 --- a/components/tvplanit/source/vpganttview.pas +++ b/components/tvplanit/source/vpganttview.pas @@ -1281,6 +1281,8 @@ begin nDays := DayOf(FEndDate) else nDays := DaysInMonth(dm); + if dm + nDays > FEndDate then + nDays := trunc(FEndDate) - trunc(dm); x2 := x1 + nDays * ColWidth; FMonthRecords[i].Rect := Rect(x1, y1, x2, y2); FMonthRecords[i].Date := dm;