mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
lv_calendar_get_pressed_date: return NULL if not date pressed
This commit is contained in:
parent
a4c6d511b7
commit
3cfe72c0fb
@ -317,11 +317,12 @@ lv_calendar_date_t * lv_calendar_get_showed_date(const lv_obj_t * calendar)
|
||||
* Get the the pressed date.
|
||||
* @param calendar pointer to a calendar object
|
||||
* @return pointer to an `lv_calendar_date_t` variable containing the pressed date.
|
||||
* `NULL` if not date pressed (e.g. the header)
|
||||
*/
|
||||
lv_calendar_date_t * lv_calendar_get_pressed_date(const lv_obj_t * calendar)
|
||||
{
|
||||
lv_calendar_ext_t * ext = lv_obj_get_ext_attr(calendar);
|
||||
return &ext->pressed_date;
|
||||
return ext->pressed_date.year != 0 ? &ext->pressed_date : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -172,6 +172,7 @@ lv_calendar_date_t * lv_calendar_get_showed_date(const lv_obj_t * calendar);
|
||||
* Get the the pressed date.
|
||||
* @param calendar pointer to a calendar object
|
||||
* @return pointer to an `lv_calendar_date_t` variable containing the pressed date.
|
||||
* `NULL` if not date pressed (e.g. the header)
|
||||
*/
|
||||
lv_calendar_date_t * lv_calendar_get_pressed_date(const lv_obj_t * calendar);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user