From a9cbbe05130f5931cd87e84308f10f3e77b9d3bd Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Mon, 19 Sep 2005 07:00:43 +0000 Subject: Fixes #315345 svn path=/trunk/; revision=30357 --- plugins/itip-formatter/itip-view.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/itip-formatter/itip-view.c') diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c index a95eb239c1..48385a4c66 100644 --- a/plugins/itip-formatter/itip-view.c +++ b/plugins/itip-formatter/itip-view.c @@ -148,7 +148,7 @@ format_date_and_time_x (struct tm *date_tm, /* Calculate a normalized "tomorrow" */ tomorrow_tm = *current_tm; - if (tomorrow_tm.tm_mday == time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon - 1)) { + if (tomorrow_tm.tm_mday == time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon)) { tomorrow_tm.tm_mday = 1; if (tomorrow_tm.tm_mon == 11) { tomorrow_tm.tm_mon = 1; @@ -162,8 +162,8 @@ format_date_and_time_x (struct tm *date_tm, /* Calculate a normalized "next seven days" */ week_tm = *current_tm; - if (week_tm.tm_mday + 6 > time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon - 1)) { - week_tm.tm_mday = (week_tm.tm_mday + 6) % time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon - 1); + if (week_tm.tm_mday + 6 > time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon)) { + week_tm.tm_mday = (week_tm.tm_mday + 6) % time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon); if (week_tm.tm_mon == 11) { week_tm.tm_mon = 1; week_tm.tm_year++; -- cgit