Slightly smarter date parsing?

Derek Atkins warlord at MIT.EDU
Mon Jan 8 09:29:13 EST 2007


Thomas Bushnell BSG <tb at becket.net> writes:

> On Sun, 2007-01-07 at 15:16 -0600, Jamuraa wrote:
>> I was putting my receipts in for the last half month or so recently
>> and noticed that I had to be careful to notice the year that the
>> receipts were in.  When putting in 12/23 or similar, I didn't get
>> December 23, 2006, but December 23, 2007.  I thought this should be
>> different, so I dove into the gnucash code and changed qof_scan_date
>> slightly to choose the last year for December if the current month is
>> January.  The patch is attached.
>
> This behavior has also always annoyed me.
>
> I can see several ways to solve it.  One, which is yours, seems the
> least satisfactory to me.  Here are a couple others:
>
> 1) Unless the date is in the "near future", assume it is in the past and
> guess the year accordingly.
>
> 2) Choose the matching date closest to the present, and set the year
> accordingly.

So you mean go (effectively) +/- 6 months?  E.g., in January, 2007 the
dates would window from July 1, 2006 - June 30, 2007?

(For the record, this annoyed me this week, too, when I was entering
a bunch of end-of-year transactions).

> Thomas

-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