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;