DateTimePickerElement
The DateTimePickerElement class is used to create a Date Picker element in a user interface.
Constructor
Name | Type | Description |
---|---|---|
elementId | string | This property in constructor accepts the Id for the element |
label | string | This property in constructor accepts the label for dropDown |
mode | enum<DateTimePickerMode>\n\n | It is the mode of the date time picker. |
from | string | It is the start date of the date time picker. |
to | string | It is the end date of the date time picker. |
timezoneCode | string | It is the time zone of the given date. |
dateTimeFormat | string | It 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:
- typescript
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
:
- typescript
// 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");