GDA: current status

Chris Shoemaker c.shoemaker at cox.net
Sat Dec 9 19:56:03 EST 2006


> > > The thing about FreqSpec is that they don't look like they need to be
> > > evenly spaced.  I don't know why you would not do that, but you might
> > > want a FreqSpec to be "last friday of every month" or "15th and 30th of
> > > every month" which Recurrence wouldn't handle.
> > 
> > Sure it could.  Recurrence has:
> > 
> >     PERIOD_END_OF_MONTH, /* This is actually a period plus a phase. */
> >     PERIOD_NTH_WEEKDAY,  /* Also a phase, e.g. Second Tueday.       */
> >     PERIOD_LAST_WEEKDAY, /* Also a phase. */
> > 
> > I'm not exactly sure how you'd handle "last friday", except perhaps by
> > "nth weekday" where n is -1 and the weekday of the first is friday.
> 
> Actually, it's much simpler than that.  "Last Friday of every month,
> beginning yester day" is represented as {12/8/2006,
> PERIOD_LAST_WEEKDAY, 1} (mult=2 would mean "last friday of every
> _other_ month, etc.)

For completeness, perhaps I should have also pointed out that it
doesn't matter that 12/8/2006 wasn't the last Friday of the month.  By
specifying LAST_WEEKDAY, it will know you mean "Friday", and the first
occurrence will be 12/29/2006.  This is all documented in Recurrence.h

-chris


More information about the gnucash-devel mailing list