{
const Eina_List *items = elm_box_children_get(api->box);
static Elm_Calendar_Mark *m = NULL;
+ struct tm t;
if (!eina_list_count(items))
return;
{
Evas_Object *cal = eina_list_nth(items, 0);
time_t the_time = (SEC_PER_YEAR * 41) + (SEC_PER_DAY * 9); /* Set date to DEC 31, 2010 */
- m = elm_calendar_mark_add(cal, "checked", gmtime(&the_time), ELM_CALENDAR_MONTHLY);
- elm_calendar_selected_time_set(cal, gmtime(&the_time));
+ m = elm_calendar_mark_add(cal, "checked", gmtime_r(&the_time, &t), ELM_CALENDAR_MONTHLY);
+ elm_calendar_selected_time_set(cal, gmtime_r(&the_time, &t));
}
break;
case STATE_MARK_WEEKLY:
Evas_Object *cal = eina_list_nth(items, 0);
time_t the_time = (SEC_PER_YEAR * 41) + (SEC_PER_DAY * 4); /* Set date to DEC 26, 2010 */
elm_calendar_mark_del(m);
- m = elm_calendar_mark_add(cal, "checked", gmtime(&the_time), ELM_CALENDAR_WEEKLY);
- elm_calendar_selected_time_set(cal, gmtime(&the_time));
+ m = elm_calendar_mark_add(cal, "checked", gmtime_r(&the_time, &t), ELM_CALENDAR_WEEKLY);
+ elm_calendar_selected_time_set(cal, gmtime_r(&the_time, &t));
}
break;
case STATE_SUNDAY_HIGHLIGHT:
Evas_Object *cal = eina_list_nth(items, 0);
time_t the_time = (SEC_PER_YEAR * 41) + (SEC_PER_DAY * 3); /* Set date to DEC 25, 2010 */
/* elm_calendar_mark_del(m); */
- m = elm_calendar_mark_add(cal, "holiday", gmtime(&the_time), ELM_CALENDAR_WEEKLY);
- elm_calendar_selected_time_set(cal, gmtime(&the_time));
+ m = elm_calendar_mark_add(cal, "holiday", gmtime_r(&the_time, &t), ELM_CALENDAR_WEEKLY);
+ elm_calendar_selected_time_set(cal, gmtime_r(&the_time, &t));
}
break;
case STATE_SELECT_DATE_DISABLED_WITH_MARKS:
Evas_Object *cal = eina_list_nth(items, 0);
time_t the_time = (SEC_PER_YEAR * 41) + (SEC_PER_DAY * 10); /* Set date to JAN 01, 2011 */
elm_calendar_select_mode_set(cal, ELM_CALENDAR_SELECT_MODE_NONE);
- elm_calendar_selected_time_set(cal, gmtime(&the_time));
+ elm_calendar_selected_time_set(cal, gmtime_r(&the_time, &t));
}
break;
case STATE_SELECT_DATE_DISABLED_NO_MARKS:
time_t the_time = (SEC_PER_YEAR * 41) + (SEC_PER_DAY * 40); /* Set date to FEB 01, 2011 */
elm_calendar_marks_clear(cal);
elm_calendar_select_mode_set(cal, ELM_CALENDAR_SELECT_MODE_NONE);
- elm_calendar_selected_time_set(cal, gmtime(&the_time));
+ elm_calendar_selected_time_set(cal, gmtime_r(&the_time, &t));
}
break;
case API_STATE_LAST:
elm_box_pack_end(bx, cal);
time_t the_time = (SEC_PER_YEAR * 41) + (SEC_PER_DAY * 9); /* Set date to DEC 31, 2010 */
- elm_calendar_selected_time_set(cal, gmtime(&the_time));
+ struct tm t;
+ elm_calendar_selected_time_set(cal, gmtime_r(&the_time, &t));
evas_object_show(cal);
{
Evas_Object *cal;
Elm_Calendar_Mark *mark;
- struct tm selected_time;
+ struct tm selected_time, t;
time_t current_time;
const char *weekdays[] =
{
elm_calendar_format_function_set(cal, _format_month_year);
time_t the_time = (SEC_PER_YEAR * 40) + (SEC_PER_DAY * 24); /* Set min date to JAN 15, 2010 */
- elm_calendar_date_min_set(cal, gmtime(&the_time));
+ elm_calendar_date_min_set(cal, gmtime_r(&the_time, &t));
the_time = (SEC_PER_YEAR * 42) + (SEC_PER_DAY * 3); /* Set max date to DEC 25, 2011 */
- elm_calendar_date_max_set(cal, gmtime(&the_time));
+ elm_calendar_date_max_set(cal, gmtime_r(&the_time, &t));
current_time = time(NULL) + 4 * SEC_PER_DAY;
localtime_r(¤t_time, &selected_time);