mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-07 18:18:30 +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);
|
||||
if FMaxDate = AValue then Exit;
|
||||
FMaxDate := AValue;
|
||||
if IsLimited and not IsNullDate(FDate) and (FDate > FMaxDate) then
|
||||
SetDate(FMaxDate);
|
||||
end;
|
||||
|
||||
procedure TDateEdit.SetMinDate(AValue: TDateTime);
|
||||
@ -2014,6 +2016,8 @@ begin
|
||||
CheckRange(AValue, MinDateTime, MaxDateTime);
|
||||
if FMinDate = AValue then Exit;
|
||||
FMinDate := AValue;
|
||||
if IsLimited and not IsNullDate(FDate) and (FDate < FMinDate) then
|
||||
SetDate(FMinDate);
|
||||
end;
|
||||
|
||||
function TDateEdit.IsLimited: Boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user