DBPlanner Week with Header Date and Day

In the moment the header per day is shown as format:
13.03.2024 / 14.03.2024 / 15.03.2024 / .....

What must I do to show it in the format:
Mo 13.03.2024 / Di 14.03.2024 / Mi 15.03.2024 / ...

function WochentagKurz(Datum: TDate): string;
begin
case DayOfWeek(Datum) of
1: Result := 'Mo';
2: Result := 'Di';
3: Result := 'Mi';
4: Result := 'Do';
5: Result := 'Fr';
6: Result := 'Sa';
7: Result := 'So';
else
Result := '';
end;
end;

The header of the planner? If so, header captions are set as text via Planner.Header.Captions

If you mean sidebar, the formatting of the datetime there is set via Planner.Sidebar.DateTimeFormat , so you can set this to 'DDD dd.mm.yyyy'

I mean the header.


Planer.header.caption := ????

Aren't you setting these header captions via
Planner.Header.Captions.Add(yourtext) ?

no, i do nothing with Planner.Header.Captions.Add(yourtext)

Then please provide sufficient details so we can understand how you did setup the TDBPlanner to come to this result.

I've solved it.

DBPlanner1.Header.Captions.Clear;
DBPlanner1.Header.Captions.Add('');
for i := 1 to DBPlanner1.Positions do
begin
DBPlanner1.Header.Captions.Add(
FormatDateTime('ddd dd/mm/yy', DBDaySource1.Day + i - 1) + ' --> [KW' + IntToStr(WeekOfTheYear(DBDaySource1.Day + i - 1))+']');
end;

1 Like

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