mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 10:36:01 +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);
|
procedure TCustomCalendar.CheckRange(ADate, AMinDate, AMaxDate: TDateTime);
|
||||||
begin
|
begin
|
||||||
//otherwise you get a message like "Invalid Date: 31-12-9999. Must be between 1-1-0001 and 31-12-9999"
|
//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)]);
|
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)]);
|
raise EInvalidDate.CreateFmt(rsDateTooLarge, [DateToStr(SysUtils.MaxDateTime)]);
|
||||||
|
|
||||||
if (ADate < AMinDate) or (ADate > AMaxDate) then
|
if (ADate < AMinDate) or (ADate > AMaxDate) then
|
||||||
|
Loading…
Reference in New Issue
Block a user