aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-09-11 17:18:01 +0800
committerMilan Crha <mcrha@redhat.com>2012-09-11 17:18:01 +0800
commitca8610aac84bca44dfc457b0b38dda0622fccba8 (patch)
treeae386a75054437eb6187ce8919860d39d83b53f7 /calendar/gui/gnome-cal.c
parent5b2547481c5f9663eef3103368cd75e6ef3f169b (diff)
downloadgsoc2013-evolution-ca8610aac84bca44dfc457b0b38dda0622fccba8.tar.gz
gsoc2013-evolution-ca8610aac84bca44dfc457b0b38dda0622fccba8.tar.zst
gsoc2013-evolution-ca8610aac84bca44dfc457b0b38dda0622fccba8.zip
Bug #683736 - Calendar work week view drops Monday's entries
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index f656a3c894..29f1f9a7d3 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -926,7 +926,8 @@ get_times_for_views (GnomeCalendar *gcal,
/* Find the first working day in the week, 0 (Mon) to 6 (Sun). */
first_day = week_start_day % 7;
for (i = 0; i < 7; i++) {
- if (day_view->working_days & (1 << first_day)) {
+ /* the working_days has stored 0 (Sun) to 6 (Sat) */
+ if (day_view->working_days & (1 << ((first_day + 1) % 7))) {
has_working_days = TRUE;
break;
}
@@ -937,7 +938,8 @@ get_times_for_views (GnomeCalendar *gcal,
/* Now find the last working day of the week, backwards. */
last_day = (first_day + 6) % 7;
for (i = 0; i < 7; i++) {
- if (day_view->working_days & (1 << last_day))
+ /* the working_days has stored 0 (Sun) to 6 (Sat) */
+ if (day_view->working_days & (1 << ((last_day + 1) % 7)))
break;
last_day = (last_day + 6) % 7;
}