mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-23 13:59:24 +01:00
TCalendar and TDateEdit: improve IsLimited function. Now it only returns true if MaxDate actually is at least one day > MinDate (it would return True if MaxDate-MinDate was larger than 0.1 msec)
This commit is contained in:
parent
d0843ab78b
commit
6cd311dd36
@ -346,7 +346,7 @@ end;
|
|||||||
|
|
||||||
function TCustomCalendar.IsLimited: Boolean;
|
function TCustomCalendar.IsLimited: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := (CompareValue(FMinDate, FMaxDate, DTEpsilon) = LessThanValue);
|
Result := (Trunc(FMaxDate)-Trunc(FMinDate) > 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomCalendar.ApplyLimits;
|
procedure TCustomCalendar.ApplyLimits;
|
||||||
|
|||||||
@ -2018,7 +2018,7 @@ end;
|
|||||||
|
|
||||||
function TDateEdit.IsLimited: Boolean;
|
function TDateEdit.IsLimited: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := (CompareValue(FMinDate, FMaxDate, DTEpsilon) = LessThanValue);
|
Result := (Trunc(FMaxDate)-Trunc(FMinDate) > 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDateEdit.GetMaxDateStored: Boolean;
|
function TDateEdit.GetMaxDateStored: Boolean;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user