[FNCPlanner[ ItemHelpers, Besides displaying start/end time, also display duration

This can be usefull for endusers when sizing a planneritem. The see directy the new duraration of the item.
So on top you get
13:00
end at the bottom something like
14:45 (1u45')

i'v hacked this myself into the planner right now.
File: FMX.TMSFNCPlanner.pas
Method: procedure TTMSFNCCustomPlanner.DrawItemHelpers(AGraphics: TTMSFNCGraphics);

Add internal procedure:
function DurationString(const AItem : TTMSFNCPlannerItem) : string;
var
minuten : Integer;
begin
minuten := MinutesBetween(AItem.EndTime, AItem.StartTime);
Result := Format(' (%du%d'')', [minuten div 60, minuten mod 60]);
end;
And at about line 9122
txt := FormatDateTime('hh:nn', dt);
change to:
txt := FormatDateTime('hh:nn', dt) + DurationString(it);

image

See the red arrow :slight_smile:

please consider :slight_smile:
(have to adapt this adjustment with every update)

You can do this via the OnGetItemHelperText event

uses
  DateUtils;

procedure TForm1.TMSFNCPlanner1GetItemHelperText(Sender: TObject;
  AItem: TTMSFNCPlannerItem; AIsStartTime: Boolean; AValue: TDateTime;
  var AText: string);

  function DurationString(const AItem : TTMSFNCPlannerItem) : string;
  var
    minuten : Integer;
  begin
    minuten := MinutesBetween(AItem.EndTime, AItem.StartTime);
    Result := Format(' (%du%d'')', [minuten div 60, minuten mod 60]);
  end;

begin
  if not AIsStartTime then
    AText := AText + DurationString(AItem);
end;

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