r16798 - gnucash/branches/2.2/src/gnome-utils - [r16769] Bug#506429: Correct widget index offset computation for last-day-of-month SXes.

Andreas Köhler andi5 at cvs.gnucash.org
Fri Jan 4 19:53:05 EST 2008


Author: andi5
Date: 2008-01-04 19:53:05 -0500 (Fri, 04 Jan 2008)
New Revision: 16798
Trac: http://svn.gnucash.org/trac/changeset/16798

Modified:
   gnucash/branches/2.2/src/gnome-utils/gnc-frequency.c
Log:
[r16769] Bug#506429: Correct widget index offset computation for last-day-of-month SXes.

Committed by jsled.


Modified: gnucash/branches/2.2/src/gnome-utils/gnc-frequency.c
===================================================================
--- gnucash/branches/2.2/src/gnome-utils/gnc-frequency.c	2008-01-05 00:52:55 UTC (rev 16797)
+++ gnucash/branches/2.2/src/gnome-utils/gnc-frequency.c	2008-01-05 00:53:05 UTC (rev 16798)
@@ -509,9 +509,10 @@
     if (day_of_month_index > LAST_DAY_OF_MONTH_OPTION_INDEX)
     {
         GDate *day_of_week_date = g_date_new_julian(g_date_get_julian(start_date));
+        GDateWeekday selected_day_of_week = day_of_month_index - LAST_DAY_OF_MONTH_OPTION_INDEX;
         // increment until we align on the DOW, but stay inside the month
         g_date_set_day(day_of_week_date, 1);
-        while (g_date_get_weekday(day_of_week_date) != (day_of_month_index - 30))
+        while (g_date_get_weekday(day_of_week_date) != selected_day_of_week)
             g_date_add_days(day_of_week_date, 1);
         recurrenceSet(r, multiplier, PERIOD_LAST_WEEKDAY, day_of_week_date);
     }



More information about the gnucash-changes mailing list