efl_ui/timepicker: fix range clamping on 12 hour timepickers
authorMike Blumenkrantz <zmike@samsung.com>
Thu, 25 Jul 2019 18:45:48 +0000 (14:45 -0400)
committerWooHyun Jung <wh0705.jung@samsung.com>
Mon, 5 Aug 2019 01:47:35 +0000 (10:47 +0900)
Summary: this errors all the time otherwise

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: devilhorns, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9396

src/lib/elementary/efl_ui_timepicker.c

index 938c22c..59ef13d 100644 (file)
@@ -59,7 +59,7 @@ _field_value_update(Eo *obj)
 
    if (!pd->is_24hour)
      {
-        if (pd->cur_time[TIMEPICKER_HOUR] >= 12)
+        if (pd->cur_time[TIMEPICKER_HOUR] > 12)
           {
              //TODO: gets text from strftime.
              efl_text_set(pd->ampm, "PM");
@@ -68,7 +68,7 @@ _field_value_update(Eo *obj)
         else
           {
              efl_text_set(pd->ampm, "AM");
-             efl_ui_range_value_set(pd->hour, pd->cur_time[TIMEPICKER_HOUR] + 12);
+             efl_ui_range_value_set(pd->hour, pd->cur_time[TIMEPICKER_HOUR]);
           }
      }