mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-24 06:40:03 +02:00
TCalendar: use 0.1 msec as epsilon value when comparing values.
This commit is contained in:
parent
2f4e270270
commit
9eb749fb64
@ -189,6 +189,9 @@ implementation
|
|||||||
uses
|
uses
|
||||||
WSCalendar;
|
WSCalendar;
|
||||||
|
|
||||||
|
const
|
||||||
|
DTEpsilon = Double(1.0)/(24*3600*1000*10); //0.1 millisec (0.000000001157407407);
|
||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
begin
|
begin
|
||||||
RegisterComponents('Misc',[TCalendar]);
|
RegisterComponents('Misc',[TCalendar]);
|
||||||
@ -307,12 +310,12 @@ end;
|
|||||||
|
|
||||||
function TCustomCalendar.GetMaxDateStored: Boolean;
|
function TCustomCalendar.GetMaxDateStored: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := not SameValue(FMaxDate, Double(0.0), 1E-9);
|
Result := not SameValue(FMaxDate, Double(0.0), DTEpsilon);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomCalendar.GetMinDateStored: Boolean;
|
function TCustomCalendar.GetMinDateStored: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := not SameValue(FMinDate, Double(0.0), 1E-9);
|
Result := not SameValue(FMinDate, Double(0.0), DTEpsilon);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomCalendar.SetDateTime(const AValue: TDateTime);
|
procedure TCustomCalendar.SetDateTime(const AValue: TDateTime);
|
||||||
@ -343,7 +346,7 @@ end;
|
|||||||
|
|
||||||
function TCustomCalendar.IsLimited: Boolean;
|
function TCustomCalendar.IsLimited: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := (CompareValue(FMinDate, FMaxDate, 1E-9) = LessThanValue);
|
Result := (CompareValue(FMinDate, FMaxDate, DTEpsilon) = LessThanValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomCalendar.ApplyLimits;
|
procedure TCustomCalendar.ApplyLimits;
|
||||||
|
Loading…
Reference in New Issue
Block a user