xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=44dbf5c22a221bef490edffc0552400b5f07b20a

commit 44dbf5c22a221bef490edffc0552400b5f07b20a
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Jul 26 16:55:48 2019 +0200

    efl_ui/datepicker: adjust datepicker minimum limits
    
    Summary:
    this whole thing seems pretty busted but at least now it won't error and
    break elm_test
    
    t.tm_mday is 0 when the function in the macro returns, so this value needs
    to be clamped like the others
    
    Reviewers: segfaultxavi
    
    Reviewed By: segfaultxavi
    
    Subscribers: segfaultxavi, cedric, #reviewers, #committers
    
    Tags: #efl_widgets
    
    Differential Revision: https://phab.enlightenment.org/D9398
---
 src/lib/elementary/efl_ui_datepicker.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/elementary/efl_ui_datepicker.c 
b/src/lib/elementary/efl_ui_datepicker.c
index 810c9bc4c4..666791b36f 100644
--- a/src/lib/elementary/efl_ui_datepicker.c
+++ b/src/lib/elementary/efl_ui_datepicker.c
@@ -18,7 +18,7 @@
      Efl_Time t = efl_datetime_manager_value_get(pd->dt_manager);    \
      pd->cur_date[DATEPICKER_YEAR] = t.tm_year + 1900;               \
      pd->cur_date[DATEPICKER_MONTH] = t.tm_mon + 1;                  \
-     pd->cur_date[DATEPICKER_DAY] = t.tm_mday;                       \
+     pd->cur_date[DATEPICKER_DAY] = t.tm_mday + 1;                   \
    } while (0)
 
 #define DATE_SET()                                                   \
@@ -26,7 +26,7 @@
      Efl_Time t;                                                     \
      t.tm_year = pd->cur_date[DATEPICKER_YEAR] - 1900;               \
      t.tm_mon = pd->cur_date[DATEPICKER_MONTH] - 1;                  \
-     t.tm_mday = pd->cur_date[DATEPICKER_DAY];                       \
+     t.tm_mday = pd->cur_date[DATEPICKER_DAY]  - 1;                  \
      t.tm_sec = 0;                                                   \
      efl_datetime_manager_value_set(pd->dt_manager, t);              \
    } while (0)
@@ -160,7 +160,7 @@ _fields_init(Eo *obj)
 
    //Field create.
    pd->year = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
-                      efl_ui_range_limits_set(efl_added, 1970, 2037),
+                      efl_ui_range_limits_set(efl_added, 1900, 2037),
                       efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
                       efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
                       efl_ui_layout_orientation_set(efl_added, 
EFL_UI_LAYOUT_ORIENTATION_VERTICAL),

-- 


Reply via email to