summaryrefslogtreecommitdiff
path: root/src/modules/datetime_input_ctxpopup
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-08-29 07:09:08 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-08-29 07:09:08 +0000
commit0875d1729ba83ba90070c3037f805d49fd24cfd7 (patch)
tree63f551d6e4a5c350c98c7c60f16e439be723d2c4 /src/modules/datetime_input_ctxpopup
parent367fc867d496f97b570955ad3129d35355cdbd48 (diff)
fallback for not working strftime for am/pm - based on patch from
rajeev but redone simpler. SVN revision: 75811
Diffstat (limited to 'src/modules/datetime_input_ctxpopup')
-rw-r--r--src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c b/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c
index 043bc65b4..7c58d32b9 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)
264 elm_datetime_value_get(ctx_mod->mod_data.base, &tim); 264 elm_datetime_value_get(ctx_mod->mod_data.base, &tim);
265 field_type = (Elm_Datetime_Field_Type )evas_object_data_get(obj, "_field_type"); 265 field_type = (Elm_Datetime_Field_Type )evas_object_data_get(obj, "_field_type");
266 fmt = ctx_mod->mod_data.field_format_get(ctx_mod->mod_data.base, field_type); 266 fmt = ctx_mod->mod_data.field_format_get(ctx_mod->mod_data.base, field_type);
267 buf[0] = 0;
267 strftime(buf, sizeof(buf), fmt, &tim); 268 strftime(buf, sizeof(buf), fmt, &tim);
269 if ((!buf[0]) && ((!strcmp(fmt, "%p")) || (!strcmp(fmt, "%P"))))
270 {
271 // yes BUFF_SIZE is more than 2 bytes!
272 if (tim.tm_hour < 12) strcpy(buf, "AM");
273 else strcpy(buf, "PM");
274 }
268 elm_object_text_set(obj, buf); 275 elm_object_text_set(obj, buf);
269} 276}
270 277