restore last-day-of-month tracking

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15501 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Joshua Sled 2007-02-04 21:08:23 +00:00
parent 8b389efc60
commit 6f417c8247

View File

@ -1299,7 +1299,16 @@ gnc_get_reconcile_info (Account *account,
xaccAccountGetReconcileLastInterval (account, &months, &days); xaccAccountGetReconcileLastInterval (account, &months, &days);
if (months) { if (months) {
gboolean was_last_day_of_month = g_date_is_last_of_month(&date);
g_date_add_months(&date, months); 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 { } else {
g_date_add_days(&date, days); g_date_add_days(&date, days);
} }