TCalendar: don't truncate MinDateTime or MaxDateTime in CheckRange.

This commit is contained in:
Bart 2022-07-19 13:59:25 +02:00
parent 6167bca327
commit 3dba52b4eb

View File

@ -283,9 +283,9 @@ end;
procedure TCustomCalendar.CheckRange(ADate, AMinDate, AMaxDate: TDateTime);
begin
//otherwise you get a message like "Invalid Date: 31-12-9999. Must be between 1-1-0001 and 31-12-9999"
if (ADate < Trunc(SysUtils.MinDateTime)) then
if (ADate < SysUtils.MinDateTime) then
raise EInvalidDate.CreateFmt(rsDateTooSmall, [DateToStr(SysUtils.MinDateTime)]);
if (ADate > Trunc(SysUtils.MaxDateTime)) then
if (ADate > SysUtils.MaxDateTime) then
raise EInvalidDate.CreateFmt(rsDateTooLarge, [DateToStr(SysUtils.MaxDateTime)]);
if (ADate < AMinDate) or (ADate > AMaxDate) then