calendar: weekday update when first day of week changed.
Summary: When user call elm_calendar_first_day_of_week_set() to change first day of week. the marked day has to update. But, it's not updated, because of internal logic error. I fixed internal logic for update specific day mark. @fix Test Plan: Called elm_calendar_mark_add() Then called elm_calendar_first_day_of_week_set( Check the mark in not updated. Reviewers: Hermet, cedric Reviewed By: cedric Differential Revision: https://phab.enlightenment.org/D3100 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
c73814da24
commit
a80331c26c
|
@ -414,7 +414,7 @@ _access_calendar_register(Evas_Object *obj)
|
|||
static void
|
||||
_populate(Evas_Object *obj)
|
||||
{
|
||||
int maxdays, prev_month_maxdays, day, mon, yr, i;
|
||||
int maxdays, adjusted_wday, prev_month_maxdays, day, mon, yr, i;
|
||||
Elm_Calendar_Mark *mark;
|
||||
char part[12], day_s[3];
|
||||
struct tm first_day;
|
||||
|
@ -580,8 +580,13 @@ _populate(Evas_Object *obj)
|
|||
day = mtime->tm_mday;
|
||||
else
|
||||
break;
|
||||
|
||||
adjusted_wday = (mtime->tm_wday - sd->first_week_day);
|
||||
if (adjusted_wday < 0)
|
||||
adjusted_wday = ELM_DAY_LAST + adjusted_wday;
|
||||
|
||||
for (; day <= maxdays; day++)
|
||||
if (mtime->tm_wday == _weekday_get(sd->first_day_it, day))
|
||||
if (adjusted_wday == _weekday_get(sd->first_day_it, day))
|
||||
_cit_mark(obj, day + sd->first_day_it - 1,
|
||||
mark->mark_type);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue