mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-08 05:18:17 +02:00
TDateEdit: adjust Date if necessary when setting MinDate/MaxDate.
This commit is contained in:
parent
6cd311dd36
commit
0fbba1a726
@ -2007,6 +2007,8 @@ begin
|
|||||||
CheckRange(AValue, MinDateTime, MaxDateTime);
|
CheckRange(AValue, MinDateTime, MaxDateTime);
|
||||||
if FMaxDate = AValue then Exit;
|
if FMaxDate = AValue then Exit;
|
||||||
FMaxDate := AValue;
|
FMaxDate := AValue;
|
||||||
|
if IsLimited and not IsNullDate(FDate) and (FDate > FMaxDate) then
|
||||||
|
SetDate(FMaxDate);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDateEdit.SetMinDate(AValue: TDateTime);
|
procedure TDateEdit.SetMinDate(AValue: TDateTime);
|
||||||
@ -2014,6 +2016,8 @@ begin
|
|||||||
CheckRange(AValue, MinDateTime, MaxDateTime);
|
CheckRange(AValue, MinDateTime, MaxDateTime);
|
||||||
if FMinDate = AValue then Exit;
|
if FMinDate = AValue then Exit;
|
||||||
FMinDate := AValue;
|
FMinDate := AValue;
|
||||||
|
if IsLimited and not IsNullDate(FDate) and (FDate < FMinDate) then
|
||||||
|
SetDate(FMinDate);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDateEdit.IsLimited: Boolean;
|
function TDateEdit.IsLimited: Boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user