Defines a line-edit with a calendar widget to pick a date.
The DATEEDIT form item defines a field that can open a calendar to ease date input.
To store the field value, use a DATE program variable with this form item.
The DATEEDIT form item type allows the user to edit date values with a specific widget for date input. A DATEEDIT field typically provides a calendar widget, to let the end user pick a date from it.
When using a DATE variable as recommended, with desktop front-ends, the format of DATEEDIT fields is by default defined by the DBDATE environment variable as for other editor fields. Specific format can be defined with the FORMAT attribute, but it is recommended to use the default date formatting. On mobile platforms, the date format is defined by the device OS language settings.
On some front-end platforms, the native widget used for DATEEDIT fields allows only pure date value input, and therefore cannot be used with a CONSTRUCT instruction, where it must be possible to enter search filters like ">=24/03/2014".Some front-ends support different presentation and behavior options, which can be controlled by a STYLE attribute. For more details, see Common style attributes and DateEdit style attributes.
To inform the dialog when a date is picked from the calendar widget, define an ON CHANGE block for the DATEEDIT field. The program can then react immediately to user changes in the field:
-- Form file (grid layout) DATEEDIT de1 = order.ord_shipdate, NOT NULL; -- Program file: ON CHANGE ord_shipdate -- An new date value was picked from the calendar
For more details, see Reacting to field value changes.
In a grid-based layout, the size of a DATEEDIT widget is computed according to layout rules as described in Widget size within hbox tags.
In a stack-based layout, the widget will take the full width available in the parent container.
The input length in a DATEEDIT fields is defined by the (DATE) program variable. In a grid-based layout, define an item tag with 10 positions, to be able to display dates with 4 year digits. For more details, see Field input length.