From: Carsten Haitzler Date: Wed, 29 Aug 2012 07:09:08 +0000 (+0000) Subject: fallback for not working strftime for am/pm - based on patch from X-Git-Tag: v1.7.0~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0875d1729ba83ba90070c3037f805d49fd24cfd7;p=platform%2Fupstream%2Felementary.git fallback for not working strftime for am/pm - based on patch from rajeev but redone simpler. SVN revision: 75811 --- diff --git a/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c b/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c index 043bc65..7c58d32 100644 --- a/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c +++ b/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c @@ -264,7 +264,14 @@ field_value_display(Elm_Datetime_Module_Data *module_data, Evas_Object *obj) elm_datetime_value_get(ctx_mod->mod_data.base, &tim); field_type = (Elm_Datetime_Field_Type )evas_object_data_get(obj, "_field_type"); fmt = ctx_mod->mod_data.field_format_get(ctx_mod->mod_data.base, field_type); + buf[0] = 0; strftime(buf, sizeof(buf), fmt, &tim); + if ((!buf[0]) && ((!strcmp(fmt, "%p")) || (!strcmp(fmt, "%P")))) + { + // yes BUFF_SIZE is more than 2 bytes! + if (tim.tm_hour < 12) strcpy(buf, "AM"); + else strcpy(buf, "PM"); + } elm_object_text_set(obj, buf); }