ejDateTimePicker
Namespace: Wisej.Web.Ext.Syncfusion
Assembly: Wisej.Web.Ext.Syncfusion (4.1.0.0)
The Essential JavaScript DateTimePicker control is used to input the date and time with a specific format. The DateTimePicker control combines the DatePicker and TimePicker controls so that users can select the date and time with their desired format.
- C#
- VB.NET
public class ejDateTimePicker : ejBase
Public Class ejDateTimePicker
Inherits ejBase
Constructors
ejDateTimePicker()
Constructs a new instance of the ejDateTimePicker class.
Example:
The following example creates the date time picker and sets the format and the value through the options.
var dateTimePicker = new ejDateTimePicker();
dateTimePicker.Options.dateTimeFormat = "dd/MM/yyyy HH:mm";
dateTimePicker.Options.value = "25/12/2025 18:30";
dateTimePicker.Location = new Point(20, 20);
this.Controls.Add(dateTimePicker);
ejDateTimePicker(options)
Constructs a new instance of the ejDateTimePicker class.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial set of options. |
Example:
The following example creates a date time picker that lists the times every 15 minutes.
var dateTimePicker = new ejDateTimePicker(new
{
dateTimeFormat = "MM/dd/yyyy hh:mm tt",
interval = 15
});
this.Controls.Add(dateTimePicker);
Properties
Text
String: Gets or sets the text for the ejDateTimePicker. (Default: "")
The property reads and writes the value option of the widget, which is the date and time formatted according to the dateTimeFormat option, and raises the TextChanged event every time it is assigned. It is not updated when the user changes the value in the browser: handle the change event of the widget to receive the value selected by the user.
Example:
// set the value using the format defined in the dateTimeFormat option.
this.dateTimePicker1.Options.dateTimeFormat = "dd/MM/yyyy HH:mm";
this.dateTimePicker1.Text = "25/12/2025 18:30";
// receive the value selected by the user.
this.dateTimePicker1.Instance.onChange += new WidgetEventHandler((s, e) =>
{
AlertBox.Show($"Selected value: {e.Data.value}");
});