From 6f417c8247443df7938db4032e11dc77d798d1af Mon Sep 17 00:00:00 2001 From: Joshua Sled Date: Sun, 4 Feb 2007 21:08:23 +0000 Subject: [PATCH] restore last-day-of-month tracking git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15501 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome/window-reconcile.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gnome/window-reconcile.c b/src/gnome/window-reconcile.c index 18cc6885b4..69bae509f3 100644 --- a/src/gnome/window-reconcile.c +++ b/src/gnome/window-reconcile.c @@ -1299,7 +1299,16 @@ gnc_get_reconcile_info (Account *account, xaccAccountGetReconcileLastInterval (account, &months, &days); if (months) { + gboolean was_last_day_of_month = g_date_is_last_of_month(&date); + g_date_add_months(&date, months); + + /* Track last day of the month, i.e. 1/31 -> 2/28 -> 3/31 */ + if (was_last_day_of_month) + { + g_date_set_day(&date, g_date_get_days_in_month(g_date_get_month(&date), + g_date_get_year(&date))); + } } else { g_date_add_days(&date, days); }