Function

MakeRelativeDateTime

Module

rCore

Last Modified

7/15/2014 3:26:44 PM

Scope

Interfaced

Declaration

function MakeRelativeDateTime(FMDateTime: TFMDateTime): string;

Calls Hierarchy


MakeRelativeDateTime
 └FMToday
   └FMNow

Called-By Hierarchy


                          MakeRelativeDateTime
                        SaveOrderViewDefault┤ 
           TfrmOrders.mnuViewDfltSaveClick┘ │ 
                    TfrmODLab.SetupCollTimes┤ 
                      TfrmODLab.FormCreate┤ │ 
                     TfrmODLab.SetupDialog┤ │ 
                    TfrmODLab.LoadCollType┤ │ 
             TfrmODLab.cboCollSampChange┤ │ │ 
                 TfrmODLab.SetupDialog┤ │ │ │ 
          TfrmODLab.cboAvailTestSelect┘ │ │ │ 
               TfrmODLab.SetupDialog┤   │ │ │ 
          TfrmODLab.cboAvailTestExit┘   │ │ │ 
   TfrmODLab.DetermineCollectionDefaults┘ │ │ 
                 TfrmODLab.SetupDialog┤   │ │ 
       TfrmODLab.cboAvailTestSelect...┘   │ │ 
               TfrmODLab.cboCollTypeChange┤ │ 
  TfrmODLab.DetermineCollectionDefaults...┘ │ 
                  TfrmODBBank.SetupCollTimes┤ 
                  TfrmODBBank.LoadCollType┤ │ 
 TfrmODBBank.DetermineCollectionDefaults┘ │ │ 
        TfrmODBBank.cboAvailTestSelect┘   │ │ 
             TfrmODBBank.SetupDialog┤     │ │ 
        TfrmODBBank.cboAvailTestExit┘     │ │ 
TfrmODBBank.DetermineCollectionDefaults...┤ │ 
             TfrmODBBank.cboCollTypeChange┘ │ 
             TfrmOrders.mnuViewDfltSaveClick┤ 
       TfrmOptionsReportsCustom.odbStartExit┤ 
        TfrmOptionsReportsCustom.odbStopExit┘ 

Calls

Name Declaration Comments
FMToday function FMToday: TFMDateTime; -

Called-By

Name Declaration Comments
TfrmOrders.mnuViewDfltSaveClick procedure mnuViewDfltSaveClick(Sender: TObject); -
TfrmOptionsReportsCustom.odbStartExit procedure odbStartExit(Sender: TObject); -
TfrmOptionsReportsCustom.odbStopExit procedure odbStopExit(Sender: TObject); -
SaveOrderViewDefault procedure SaveOrderViewDefault(AView: TOrderView); -
TfrmODLab.SetupCollTimes procedure SetupCollTimes(CollType: string); -
TfrmODBBank.SetupCollTimes procedure SetupCollTimes(CollType: string); -


Source

266   function MakeRelativeDateTime(FMDateTime: TFMDateTime): string;
267   var
268     Offset: Integer;
269     h,n,s,l: Word;
270     ADateTime: TDateTime;
271     ATime: string;
272   begin
273     Result := '';
274     if FMDateTime <= 0 then Exit;
275     ADateTime := FMDateTimeToDateTime(FMDateTime);
276     Offset := Trunc(Int(ADateTime) - Int(FMDateTimeToDateTime(FMToday)));
277     if Offset < 0 then Result := 'T' + IntToStr(Offset)
278     else if Offset = 0 then Result := 'T'
279     else Result := 'T+' + IntToStr(Offset);
280     DecodeTime(ADateTime, h, n, s, l);
281     ATime := Format('@%.2d:%.2d', [h, n]);
282     if ATime <> '@00:00' then Result := Result + ATime;
283   end;