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.

On desktop (GDC/GBC) and browser (GAS/GBC), the time value picker is generic and common to both front-end platforms. On mobile devices (GMA and GMI), when the dialog is an INPUT, the native time picker is used to edit the value. With a CONSTRUCT, the generic time picker is used to let the user enter a search criteria.

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.

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.
  • The time value picker/editor may not allow to specify NULL.
  • 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.

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,

-- 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.