Skip to main content

DateTimePickerElement

The DateTimePickerElement class is used to create a Date Picker element in a user interface.

Constructor

NameTypeDescription
elementIdstringThis property in constructor accepts the Id for the element
labelstringThis property in constructor accepts the label for dropDown
modeenum<DateTimePickerMode>\n\nIt is the mode of the date time picker.
fromstringIt is the start date of the date time picker.
tostringIt is the end date of the date time picker.
timezoneCodestringIt is the time zone of the given date.
dateTimeFormatstringIt is the format of the date time picker.

Class Usage

Here's an example of how you can create an instance of the DateTimePickerElement class:

const dateTimePickerElement = new DateTimePickerElement(
"1",
"Select Date",
DateTimePickerMode.date,
"UTC",
true);

Example

Here is an example that showcases the creation and manipulation of an instance of DropdownElement:

// Create a new instance of DropdownElement

const dateTimePickerElement = new DateTimePickerElement(
"1",
"Select Date",
DateTimePickerMode.dateTime,
"UTC",
true);

// Set and get the default value

dateTimePickerElement.setDefaultValue("2021-12-12T12:12");
dateTimePickerElement.setFrom("2021-12-12T12:12");
dateTimePickerElement.setTo("2021-12-12T12:12");
dateTimePickerElement.setDateTimeFormat("yyyy-MM-ddTHH:mm");