elm_calendar: fix first week is not changed
authorJiwon Kim <jwkim0000@gmail.com>
Wed, 6 Jul 2016 19:49:43 +0000 (12:49 -0700)
committerCedric BAIL <cedric@osg.samsung.com>
Wed, 6 Jul 2016 19:49:45 +0000 (12:49 -0700)
Summary: @fix

Test Plan:
1. elm_calendar_first_day_of_week_set(cal, ELM_DAY_MONDAY);
2. First week string should be changed to "Mon"

Reviewers: tasn, cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/elementary/elm_calendar.c

index 85a7f28..2782ec3 100644 (file)
@@ -717,7 +717,7 @@ _set_headers(Evas_Object *obj)
                     }
                }
              part[3] = i + '0';
-             elm_layout_text_set(obj, part, sd->weekdays[i]);
+             elm_layout_text_set(obj, part, sd->weekdays[(i + sd->first_week_day) % ELM_DAY_LAST]);
              weekday += 86400; /* Advance by a day */
           }
     }