r15501 - gnucash/trunk/src/gnome - restore last-day-of-month tracking

Josh Sled jsled at cvs.gnucash.org
Sun Feb 4 16:08:24 EST 2007


Author: jsled
Date: 2007-02-04 16:08:23 -0500 (Sun, 04 Feb 2007)
New Revision: 15501
Trac: http://svn.gnucash.org/trac/changeset/15501

Modified:
   gnucash/trunk/src/gnome/window-reconcile.c
Log:
restore last-day-of-month tracking

Modified: gnucash/trunk/src/gnome/window-reconcile.c
===================================================================
--- gnucash/trunk/src/gnome/window-reconcile.c	2007-02-04 18:04:57 UTC (rev 15500)
+++ gnucash/trunk/src/gnome/window-reconcile.c	2007-02-04 21:08:23 UTC (rev 15501)
@@ -1299,7 +1299,16 @@
     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);
     }



More information about the gnucash-changes mailing list