Form items / Form item types |
Defines a line-edit with a calendar widget to pick a datetime.
The DATETIMEEDIT form item defines a field that can open a calendar to ease date-time input.
To store the field value, use a DATETIME YEAR TO MINUTE or DATETIME YEAR TO SECOND program variable with such form item.
The DATETIMEEDIT form item type allows the user to edit date-time values with a specific widget for date-time input. A DATETIMEEDIT field typically provides a calendar and clock widget, to let the end user pick a date and time from it.
The display and input precision (time part with or without seconds) of the DATETIMEEDIT widget depends from the front-end. On some platforms, native date-time editors do not handle the seconds. Further, some front-ends (especially on mobile devices) deny data types different from DATETIME YEAR TO {MINUTE|SECOND}.
On some front-end platforms, the native widget used for DATETIMEEDIT fields allows only pure date-time value input, and therefore cannot be used with a CONSTRUCT instruction, where it must be possible to enter search filters like ">= 2014-01-23 11:00".
Some front-ends support different presentation and behavior options, which can be controlled by a STYLE attribute. For more details, see Common style attributes.
To inform the dialog when a date-time is picked from the calendar widget, define an ON CHANGE block for the DATETIMEEDIT field. The program can then react immediately to user changes in the field:
-- Form file (grid layout) DATETIMEEDIT dt1 = order.ord_shipdate, NOT NULL; -- Program file: ON CHANGE ord_shipdate -- An new date-time value was picked from the calendar
For more details, see Reacting to field value changes.
In a grid-based layout, the size of a DATETIMEEDIT 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 DATETIMEEDIT fields is defined by the (DATETIME) program variable. In a grid-based layout, define an item tag with enough positions, to be able to display dates with 4 year digits. For more details, see Field input length.