Skip to main content

TimePicker

A control that allows a user to select time value either by moving handles along track bars or by entering hour and minutes values directly into related inputs.

TimePicker

Related sample: Form. All DhxForm Inputs

Related sample: Form. TimePicker

Adding TimePicker

You can easily add a TimePicker control during initialization of a form:

var form = new dhx.Form("form_container", {
rows: [
{
type: "timepicker",
name: "timepicker",
label: "time",
labelWidth: "50px",
timeFormat: 12,
valueFormat: "timeObject",
value: [6,20,"AM"]
}
]
});

Properties

View the full list of configuration properties of the TimePicker control.

Working with TimePicker

You can manipulate a TimePicker control by using methods or events of the object returned by the getItem() method.

For example, you can get the value of the control:

var value = form.getItem("timepicker").getValue();

Methods:

Check the full list of methods of the Timepicker control.

Events:

Check the full list of events of the Timepicker control.

Working with the dhtmlxTimePicker widget

There is a possibility to use methods of DHTMLX TimePicker via the getWidget() method of a TimePicker control.

For example, you can set value for a TimePicker control. To do this, you need to get the widget attached to the TimePicker control and then use the setValue() method of this widget.

var timepicker = form.getItem("timepicker").getWidget();  // -> TimePicker
timepicker.setValue("00:39"); //set the value as a string

Related sample: Form. Get Widget Of Control

Check the full list of methods of the DHTMLX Timepicker component which you can apply via the getWidget() method.