aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-08-03 18:03:40 +0800
committerMilan Crha <mcrha@redhat.com>2009-08-03 18:03:40 +0800
commitd92118087457f7543442e1a23d7ae59c61bc201e (patch)
tree885ff0bbbb8880ba869613e3864c34d2eb5f6dfd /calendar/gui
parentbbc5c5afd182a0123637a8c50243ce65254c9aa6 (diff)
downloadgsoc2013-evolution-d92118087457f7543442e1a23d7ae59c61bc201e.tar
gsoc2013-evolution-d92118087457f7543442e1a23d7ae59c61bc201e.tar.gz
gsoc2013-evolution-d92118087457f7543442e1a23d7ae59c61bc201e.tar.bz2
gsoc2013-evolution-d92118087457f7543442e1a23d7ae59c61bc201e.tar.lz
gsoc2013-evolution-d92118087457f7543442e1a23d7ae59c61bc201e.tar.xz
gsoc2013-evolution-d92118087457f7543442e1a23d7ae59c61bc201e.tar.zst
gsoc2013-evolution-d92118087457f7543442e1a23d7ae59c61bc201e.zip
Bug #324676 - Print preview displays preview of previous month
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/calendar-commands.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
index 8e50899a61..f91442a109 100644
--- a/calendar/gui/calendar-commands.c
+++ b/calendar/gui/calendar-commands.c
@@ -91,6 +91,25 @@ calendar_command_print (GnomeCalendar *gcal, GtkPrintOperationAction action)
time_t start;
gnome_calendar_get_current_time_range (gcal, &start, NULL);
+
+ if (gnome_calendar_get_view (gcal) == GNOME_CAL_MONTH_VIEW) {
+ EWeekView *week_view = E_WEEK_VIEW (gnome_calendar_get_current_view_widget (gcal));
+
+ if (week_view && week_view->multi_week_view && week_view->weeks_shown >= 4 && g_date_valid (&week_view->first_day_shown)) {
+ GDate date = week_view->first_day_shown;
+ struct icaltimetype start_tt = icaltime_null_time ();
+
+ g_date_add_days (&date, 7);
+
+ start_tt.is_date = TRUE;
+ start_tt.year = g_date_get_year (&date);
+ start_tt.month = g_date_get_month (&date);
+ start_tt.day = g_date_get_day (&date);
+
+ start = icaltime_as_timet (start_tt);
+ }
+ }
+
print_calendar (gcal, action, start);
}
}