Datetime: Using Datetime
This tutorial explains how you can create UI components that allow the user to select a date or time.
This feature is supported in wearable applications only.
Warm-up
Become familiar with the Datetime API basics by learning about:
-
Creating a Date Picker
Create a datetime component with the datepicker style.
-
Creating a Time Picker
Create a datetime component with the timepicker style.
Creating a Date Picker
Use the elm_datetime component to add a date picker style (Year : Month : Day).
The following example creates the datepicker-styled Datetime and adds it in the conform.
// Add a datepicker style Datetime component datetime = elm_datetime_add(ad->win); evas_object_size_hint_align_set(datetime, EVAS_HINT_FILL, 0.5); evas_object_size_hint_weight_set(datetime, EVAS_HINT_EXPAND, 1.0); elm_object_style_set(datetime, "datepicker_layout"); evas_object_show(datetime); elm_object_content_set(ad->conform, datetime);
Creating a Time Picker
Use the elm_datetime component to add a time picker style (Hour(12) : Min : AM/PM, or Hour(24) : Min).
The following example creates the timepicker-styled Datetime and adds it in the conform.
// Add a timepicker style Datetime component datetime = elm_datetime_add(ad->win); evas_object_size_hint_align_set(datetime, EVAS_HINT_FILL, 0.5); evas_object_size_hint_weight_set(datetime, EVAS_HINT_EXPAND, 1.0); elm_object_style_set(datetime, "timepicker_layout"); evas_object_show(datetime); elm_object_content_set(ad->conform, datetime);