mhhabib
mhhabib

Reputation: 3121

How to set customize date format in tizen native app

I want to set minute and second in timer app. But when i use FORMAT "%T" it shows hour and minute. Get this picture for the following format

My code where i set the time and it shows by default Hr & Min

elm_datetime_format_set(datetime, FORMAT);
elm_object_style_set(datetime, "timepicker/circle");
elm_object_part_content_set(layout, "elm.swallow.content", datetime);
Elm_Datetime_Time dt;
dt.tm_hour = dt.tm_min = dt.tm_sec = 0;
elm_datetime_value_set(datetime, &dt);

Upvotes: 0

Views: 198

Answers (1)

Woochan Lee
Woochan Lee

Reputation: 176

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

ELM_DATETIME_YEAR: Year field

ELM_DATETIME_MONTH: Month field

ELM_DATETIME_DATE: Date field

ELM_DATETIME_HOUR: Hour field

ELM_DATETIME_MINUTE: Minute field

ELM_DATETIME_AMPM: AM/PM field

As following development guide, the second is not available on datetime.

I guess you are working on tizen-stdio. If so, the UiComponents will helps.

File->New->Tizen Project->Sample->Wearable->Native Application->UI->(Circle)UI Components->Finish

After create sample application you can see the sample for that in src->eext_spinner.c

minute = elm_spinner_add(layout);
elm_object_style_set(minute, "circle");
//Circle spinner add for circular visual interaction with rotary event.
eext_circle_object_spinner_add(minute, ad->circle_surface);
elm_spinner_min_max_set(minute, 0.0, 59.0);
elm_object_part_text_set(minute, "elm.text", "Minute");
evas_object_smart_callback_add(minute, "focused", _focused_cb, minute);
elm_object_part_content_set(layout, "minute", minute);

second = elm_spinner_add(layout);
elm_object_style_set(second, "circle");
//Circle spinner add for circular visual interaction with rotary event.
eext_circle_object_spinner_add(second, ad->circle_surface);
elm_spinner_min_max_set(second, 0.0, 59.0);
elm_object_part_text_set(second, "elm.text", "Second");
evas_object_smart_callback_add(second, "focused", _focused_cb, second);
elm_object_part_content_set(layout, "second", second);

There are three fields (Hour, Min, Sec) tho, you can refer that codes.

Upvotes: 1

Related Questions