mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 06:09:29 +02:00
TCalendar: don't truncate MinDateTime or MaxDateTime in CheckRange.
This commit is contained in:
parent
6167bca327
commit
3dba52b4eb
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user