mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-08 05:18:17 +02:00
TDateEdit: use 0.1 msec as epsilon value when comparing TDateTime values.
This commit is contained in:
parent
9eb749fb64
commit
37fa159874
@ -921,6 +921,9 @@ implementation
|
|||||||
|
|
||||||
{$R lcl_edbtnimg.res}
|
{$R lcl_edbtnimg.res}
|
||||||
|
|
||||||
|
const
|
||||||
|
DTEpsilon = Double(1.0)/(24*3600*1000*10); //0.1 millisec (0.000000001157407407);
|
||||||
|
|
||||||
{ TEditSpeedButton }
|
{ TEditSpeedButton }
|
||||||
|
|
||||||
procedure TEditSpeedButton.GlyphChanged(Sender: TObject);
|
procedure TEditSpeedButton.GlyphChanged(Sender: TObject);
|
||||||
@ -2010,17 +2013,17 @@ end;
|
|||||||
|
|
||||||
function TDateEdit.IsLimited: Boolean;
|
function TDateEdit.IsLimited: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := (CompareValue(FMinDate, FMaxDate, 1E-9) = LessThanValue);
|
Result := (CompareValue(FMinDate, FMaxDate, DTEpsilon) = LessThanValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDateEdit.GetMaxDateStored: Boolean;
|
function TDateEdit.GetMaxDateStored: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := not SameValue(FMaxDate, Double(0.0), 1E-9);
|
Result := not SameValue(FMaxDate, Double(0.0), DTEpsilon);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDateEdit.GetMinDateStored: Boolean;
|
function TDateEdit.GetMinDateStored: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := not SameValue(FMinDate, Double(0.0), 1E-9);
|
Result := not SameValue(FMinDate, Double(0.0), DTEpsilon);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDateEdit.GetDate: TDateTime;
|
function TDateEdit.GetDate: TDateTime;
|
||||||
|
Loading…
Reference in New Issue
Block a user