GDA: current status

Derek Atkins warlord at MIT.EDU
Sat Dec 9 23:38:09 EST 2006


Quoting Chris Shoemaker <c.shoemaker at cox.net>:

>> > > 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

But what if the last MM/DD of a month falls on a Thursday, wouldn't
LAST WEEKDAY mean that?   E.g. 11/30/06 is a Thursday.  Wouldn't
LAST_WEEKDAY result in 11/30?  How would I specify "last friday"
(which should result in 11/24)?

> -chris

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list