Tasks are moved/calculated incorrectly for certain holidays values

I have a task (WorkTimePolicy := whWorkDaysOnly) that starts on October 2, 2025, and is scheduled to last three days. I have also designated October 3 as a holiday. The component is correctly moved in the timeline and the holiday is taken into account. This also works when I insert additional holidays before and after.

However, it no longer works if I add holidays that
a) fall on a Saturday or Sunday or
b) if I enter two consecutive days as holidays, for example: December 25, 2025 (Christmas Day) and December 26, 2025 (Boxing Day) as separate entries.
It doesn't matter whether I use “h.Name” and/or “h.DisplayName” or not as shown in the source code below.
By the way: does “DisplayName” currently have any function in the TimeLine at all?
Is this a known bug or am I doing something wrong?
Thank you in advance for any tips.

Source code snippet:

 procedure _AddHolidays;
  var
    h: TTMSFNCGanttHoliday;
  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;

      { Loop: }
      h := TMSFNCGanttChart1.Project.WorkTime.Holidays.AddHoliday(ADate);
      (* h.Name := '';
      h.DisplayName := ''; *)
      { … }
    finally
      TMSFNCGanttChart1.Project.WorkTime.Holidays.EndUpdate;
    end;
  end;

Thank you for letting us know.
We found the problem and the next release of the TMS FNC Gantt Chart will fix this issue.

For the moment the Display Name is not used, it can be used when retrieving the holidays in case they are not readable when adding them from a database for example.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.