TIMEEDIT item type

Defines a line-edit field with a clock widget to pick a time.

TIMEEDIT item basics

The TIMEEDIT form item defines a field that allows the user to edit 24H time values, or time duration (intervals), with a specific clock widget for time input.

To store TIMEEDIT field values, use the appropriate DATETIME HOUR TO MINUTE or DATETIME HOUR TO SECOND data type, depending on the target front-end.

TIMEEDIT widget constraints

Depending on the front-end platform, the widget and time picker to render a TIMEEDIT field may have the following limitations:
  • Time editor and time picker may not handle the seconds. If the front-end does not support the data type used for the TIMEEDIT field, the runtime system will raise an error and stop the program.
  • Time editors may not allow to specify NULL.
  • The widget usually allows only strict hh:mm[:ss] time value input, and therefore cannot be used with a CONSTRUCT instruction, where it must be possible to enter search filters like ">=11:00".
  • TIMEEDIT fields may also be used to handle INTERVAL values of the class HOUR TO {MINUTE|SECOND}, in order to input a time duration. However, the time interval pickers are limited to 24H hours and allow only positive values. As result, not all values allowed in an INTERVAL HOUR TO MINUTE variable (such as -86 hours 23 minutes) can be displayed by such widgets.
Tip: Consider testing your application forms using TIMEEDIT fields with all types of front-ends.

Defining a TIMEEDIT

No specific attribute is needed to define the rendering and behavior of a TIMEEDIT field. Common data validation attributes such NOT NULL, REQUIRED, DEFAULT are allowed.

The time display format is automatically taken from the front-end platform settings. For example, time values can display in the 0-12 hour clock format (with AM/PM indicators), or in the 0-24 hour clock format.

Front-ends support different presentation and behavior options, which can be controlled by a STYLE attribute. For more details, see Style attributes common to all elements.

Detecting TIMEEDIT modification

To inform the dialog when a date is picked from the clock widget, define an ON CHANGE block for the TIMEEDIT field. The program can then react immediately to user changes in the field:

-- Form file (grid layout)
TIMEEDIT de1 = order.ord_shiptime,
   NOT NULL;

-- Program file:
ON CHANGE ord_shiptime
   -- A new time value was picked from the clock widget

For more details, see Reacting to field value changes.

Where to use a TIMEEDIT

A TIMEEDIT form item can be defined with an item tag and a TIMEEDIT item definition in a GRID, SCROLLGRID and TABLE/TREE.

Field input length

The input length in a TIMEEDIT fields is defined by the (DATETIME) program variable. Define an item tag wide enough to fit all time value digits (5 positions for HH:MM, 8 positions for HH:MM:SS). For more details, see Input length of form fields.