Time
Availability
[SINCE Orbeon Forms 2018.2]
Prior to that, Form Builder was using <xf:input>
bound to an xs:time
type.
[SINCE Orbeon Forms 2022.1]
There is no more support for <xf:input>
bound to an xs:time
type. Use this component directly instead.
Appearance
What it does
The Time component allows the user to enter a time of day. The component has two major features:
Smart input: lets the user enter a time in a variety of formats that are recognized, parsed, and then formatted
Formatting: formats the time according to a specified format
The time is a local time, which does not contain a timezone, and stored in the data in ISO Format (HH:mm:ss
).
With smart input, when the field loses the focus, the value you entered is parsed and, if recognized, replaced with a value in a canonical format.
Here are examples of supported smart time formats:
Form Builder support
The Time component is directly accessible from the Form Builder toolbox.
The Control Settings dialog features a user interface for configuring the control width and output format.
Configuration
Field width
The field-width
parameter can have two values:
natural
: takes a width defined by the componentfull
: takes the entire width of the grid cell
This parameter can be specified at the control level, form level, or in properties-local.xml
. The default is:
Output format
The oxf.xforms.format.input.time
global property configures the default output format for all instances of the Time component. The default value is:
The format is a "picture string". These are examples of values supported:
Important:
The order of components (hours, minutes, etc.) cannot be changed.
The separator is always
:
.Milliseconds are not supported.
When seconds are omitted, the user is still allowed to enter non-zero seconds. However, they will not be shown by the control when the user leaves the control.
[SINCE Orbeon Forms 2022.1.1]
The Time component adds an output-format
parameter. This parameter can be used to override the global property at the control level, the form level, or via properties-local.xml with the following new property:
As usual, the property can use an app name and form name (with possible wildcards) to specify a default value for all controls in a given app/form:
The value is in the same format as the global oxf.xforms.format.input.time
property.
By default, the output-format
parameter is not set, and the global oxf.xforms.format.input.time
property is used for backward compatibility.
Output format in readonly modes
The Time control uses the oxf.xforms.format.output.time
property to format the time value.
The default value is:
[SINCE Orbeon Forms 2022.1.1]
The Time components uses the output-format
parameter to format the time in readonly modes, including view
and pdf
.
This means that the oxf.xforms.format.output.time
property is no longer used in readonly modes.
Example usage
See also
Blog post: Time form control improvements
Last updated