ejTimePicker
Namespace: Wisej.Web.Ext.Syncfusion
Assembly: Wisej.Web.Ext.Syncfusion (4.1.0.0)
The TimePicker control for JavaScript allows users to select a time value. The available times can be restricted to a range by setting minimum and maximum time values. The TimePicker sets the time as a mask to prevent users from entering invalid values.
- C#
- VB.NET
public class ejTimePicker : ejBase
Public Class ejTimePicker
Inherits ejBase
Constructors
ejTimePicker()
Constructs a new instance of the ejTimePicker class.
Example:
The following example creates the time picker and sets the format and the time through the options.
var timePicker = new ejTimePicker();
timePicker.Options.timeFormat = "HH:mm";
timePicker.Options.value = "08:30";
timePicker.Location = new Point(20, 20);
this.Controls.Add(timePicker);
ejTimePicker(options)
Constructs a new instance of the ejTimePicker class.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial set of options. |
Example:
The following example creates a time picker limited to the office hours that lists the times every 30 minutes.
var timePicker = new ejTimePicker(new
{
timeFormat = "hh:mm tt",
minTime = "08:00 AM",
maxTime = "06:00 PM",
interval = 30
});
this.Controls.Add(timePicker);
Properties
Text
String: Gets or sets the text for the ejTimePicker. (Default: "")
The property reads and writes the value option of the widget, which is the time formatted according to the timeFormat option, and raises the TextChanged event every time it is assigned. It is not updated when the user selects a time in the browser: handle the change event of the widget to receive the time selected by the user.
Example:
// set the time using the format defined in the timeFormat option.
this.timePicker1.Options.timeFormat = "HH:mm";
this.timePicker1.Text = "17:45";
// receive the time selected by the user.
this.timePicker1.Instance.onChange += new WidgetEventHandler((s, e) =>
{
AlertBox.Show($"Selected time: {e.Data.value}");
});