Skip to main content
Version: v4

DateTimeElement

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

Properties

NameTypeDescription
elementIdstringThis property in constructor accepts the Id for the element
labelstringThis property in constructor accepts the label for dropDown
modeUIKitConstants.DateTimeModeIt 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 DateTimeElement class:

DateTimeElement dateTimeElement = new DateTimeElement("21", "12-12-2024");
dateTimeElement.setMode(UIKitConstants.DateTimeMode.DATE);
dateTimeElement.setSimpleDateFormat(new SimpleDateFormat("dd-MM-yyyy"));
dateTimeElement.setTimeZoneCode(TimeZone.getDefault().getID());

Example

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


DateTimeElement dateTimeElement = new DateTimeElement("21", "12-12-2024");
dateTimeElement.setMode(UIKitConstants.DateTimeMode.DATE);
dateTimeElement.setSimpleDateFormat(new SimpleDateFormat("dd-MM-yyyy"));
dateTimeElement.setTimeZoneCode(TimeZone.getDefault().getID());
dateTimeElement.setFrom("12-01-2024");
dateTimeElement.setTo("12-01-2025");