TimeField is a field for displaying and entering time. It is part of the DateField component, but you can also use it separately.

time field

Component’s XML-name: timeField.


To create a TimeField associated with data, you should use the dataContainer and property attributes:

@Table(name = "UIEX1_ORDER")
@Entity(name = "uiex1_Order")
public class Order {
    @Column(name = "ID", nullable = false)
    private UUID id;

    @Column(name = "DELIVERY_TIME")
    private Date deliveryTime;
    <instance id="orderDc"
        <fetchPlan extends="_base"/>
    <timeField dataContainer="orderDc"
               caption="Delivery time"/>

In the example above, the screen has the orderDc data container for the Order entity, which has the deliveryTime property. The reference to the data container is specified in the dataContainer attribute. The name of the entity attribute which value should be displayed in the field, is set in the property attribute.

Related entity attribute should have java.util.Date, java.time.LocalTime or java.time.OffsetTime type.

Time Format

  • You can define the time format by the time datatype and specify it in the localized messages pack in the timeFormat key.

  • You can also set the time format in the timeFormat attribute:

    <timeField timeFormat="mm/HH"/>



The resolution attribute allows you to define time accuracy. Accepts the following values:

  • SEC

  • MIN - default value, to within a minute.

  • HOUR

<timeField resolution="SEC"/>


The timeMode attribute allows you to choose the format for displaying the time 12-hour clock or 24-hour clock, with the corresponding values:

  • H_12

  • H_24 - by default

Events and Handlers

To generate a handler stub in Jmix Studio, select the component in the screen descriptor XML or in the Jmix UI hierarchy panel and use the Handlers tab of the Jmix UI inspector panel.

Alternatively, you can use the Generate Handler button in the top panel of the screen controller.



See Validator.


TimeField XML Attributes

TimeField XML Element