Sign in Join
FPDoc Onlineexperiment

TDateEdit.MaxDate property

Member of TDateEditpublishedIn unit EditBtn

Largest date value allowed in the date edit control.

Declaration

pascal
property MaxDate: TDateTime read FMaxDate write SetMaxDate stored GetMaxDateStored;

Description

MaxDate is a TDateTime property which indicates the largest value allowed in the Date property. Along with MinDate, it defines a range limit for possible Date values in both the edit control and the pop-up calendar form displayed when its Button is clicked.

The default value for the property is an empty date/time value (0.0), and indicates that neither MinDate nor MaxDate are used to limit the values in Date. Setting a new value for the property causes the date value to be validated. It must be in the range of valid TDateTime values defined in the RTL MinDateTime and MaxDateTime constants. An EInvalidDate exception is raised if the new value is outside the allowed range.

The value in Date is adjusted (when needed) if its value is larger than the new value for the MaxDate property. No actions are needed if MinDate and MaxDate have not been assigned, or are not at least one day apart.

Time component values (hours, minutes, seconds, milliseconds) in MaxDate are ignored in TDateEdit.

Use MinDate to specify the smallest value allowed in the Date property.

MinDate and MaxDate are not implemented for all platforms supported in the LCL. Specifically, GTK2 and GTK3 do not implement MinDate and MaxDate in their native calendar controls.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.