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:
Bart 2022-08-03 00:00:24 +02:00
parent d0843ab78b
commit 6cd311dd36
2 changed files with 2 additions and 2 deletions

View File

@ -346,7 +346,7 @@ end;
function TCustomCalendar.IsLimited: Boolean;
begin
Result := (CompareValue(FMinDate, FMaxDate, DTEpsilon) = LessThanValue);
Result := (Trunc(FMaxDate)-Trunc(FMinDate) > 0);
end;
procedure TCustomCalendar.ApplyLimits;

View File

@ -2018,7 +2018,7 @@ end;
function TDateEdit.IsLimited: Boolean;
begin
Result := (CompareValue(FMinDate, FMaxDate, DTEpsilon) = LessThanValue);
Result := (Trunc(FMaxDate)-Trunc(FMinDate) > 0);
end;
function TDateEdit.GetMaxDateStored: Boolean;