Daniel
Daniel

Reputation: 2592

How can I change "selected" field on datetime?

I'm using a date picker on Tizen (Wearable):

Evas_Object* datetime = elm_datetime_add(layout);
Evas_Object* circle_datetime = eext_circle_object_datetime_add(datetime, circlesurface);
elm_object_style_set(datetime, "datepicker/circle");

This results a layout like this:

enter image description here

By default, year has been selected, so I can immediately change it with the rotary.

I wish the day field to be selected by default.

How can I reach this?

What I've found is an ancient source of Tizen. In this file, at the bottom, there is a notation of a "FIXME":

FIXME(150420) : After deciding how to support current types to application developer, we will define these APIs' name and parameters.

And there is also a function:

EAPI void
eext_circle_object_datetime_selected_field_type_set(Evas_Object *obj, Elm_Datetime_Field_Type type)

I could fire a touch event on my desired part, but I don't know where is the datepicker/circle EDC source file.

Any help would be great, thank you!

Upvotes: 0

Views: 47

Answers (2)

Woochan Lee
Woochan Lee

Reputation: 176

Yes there is no API for your requirement.

But you can do that with below way.

  1. Gets day object in datetime layout

    Evas_Object *day_obj = elm_object_part_content_get(datetime, "field2");

  2. Set focus to given object

    elm_object_focus_set(day_obj, true);

Upvotes: 2

Woochan Lee
Woochan Lee

Reputation: 176

You can change DateTime field order as below API.

elm_datetime_format_set(datetime, "%d%b%Y");

Please refer below page for more detail.

https://docs.tizen.org/application/native/guides/ui/efl/mobile/component-datetime/

Upvotes: 0

Related Questions