Incorrect resizing of tasks before public holidays

Hello,
unfortunately I have to return to the issue regarding "Tasks are incorrectly moved for certain holiday values" (post from November 2025).

I use the following source code to create the initial situation shown below. Everything works fine:

procedure TGanttHolidayForm.FormCreate(Sender: TObject);
var
  t1, t2: TTMSFNCGanttTask;
begin
  TMSFNCGanttChart1.Project.WorkTime.WorkingHours.Clear;
  TMSFNCGanttChart1.Project.WorkTime.WorkingDays := [
    gdMonday, gdTuesday, gdWednesday, gdThursday, gdFriday];
  TMSFNCGanttChart1.TimeLineOptions.StartOfWeekDay := gdMonday;

  TMSFNCGanttChart1.Project.WorkTime.Holidays.BeginUpdate;
  try
    TMSFNCGanttChart1.Project.WorkTime.Holidays.Clear;

    TMSFNCGanttChart1.Project.WorkTime.Holidays.AddHoliday(
      EncodeDate(2026, 06, 04));
  finally
    TMSFNCGanttChart1.Project.WorkTime.Holidays.EndUpdate;
  end;

  TMSFNCGanttChart1.Project.BeginUpdate;
  try
    TMSFNCGanttChart1.Project.ClearTasks;

    t1 := TMSFNCGanttChart1.Project.AddTask(
      'T1', '', EncodeDate(2026, 05, 28), 1, gdtWorkDays, whWorkDaysOnly);
    t2 := TMSFNCGanttChart1.Project.AddTask(
      'T2', '', EncodeDate(2026, 05, 28), 2, gdtWorkDays, whWorkDaysOnly);
    t2.TaskDependencies.AddDependency(t1, gtdFinishToStart);

    t1 := TMSFNCGanttChart1.Project.AddTask(
      'T3', '', EncodeDate(2026, 05, 28), 1, gdtWorkDays, whWorkDaysOnly);
    t1.TaskDependencies.AddDependency(t2, gtdFinishToStart);
    t2 := t1;

    t1 := TMSFNCGanttChart1.Project.AddTask(
      'T4', '', EncodeDate(2026, 05, 28), 2, gdtWorkDays, whWorkDaysOnly);
    t1.TaskDependencies.AddDependency(t2, gtdFinishToStart);
    t2 := t1;

    t1 := TMSFNCGanttChart1.Project.AddTask(
      'T5', '', EncodeDate(2026, 05, 28), 1, gdtWorkDays, whWorkDaysOnly);
    t1.TaskDependencies.AddDependency(t2, gtdFinishToStart);
    //t2 := t1;
  finally
    TMSFNCGanttChart1.Project.EndUpdate;
  end;
end;

Now I’m trying to extend the “T3” bar by one day. This only works if I extend it by two days (a holiday!). Only then the bar jumps back to the desired length (= 2 days).
If I extend it by just one day, the bar jumps back to its original position – which is wrong.


Screenshot 2: This is not possible, the bar jumps back.

Conversely, if I want to shorten the bar, it doesn’t work at all.
The bar cannot be set to the day before the public holiday.


It seems to work perfectly before and after weekends. Just not before or after holidays.
I would be grateful for any advice or help.

Thank you for letting us know.
We found the cause of the issue and it will be fixed in the next release of TMS FNC Gantt Chart.

1 Like