date completion

Peter Selinger selinger at
Thu Jan 6 22:35:17 EST 2011

OK, I am attaching a patch to add this feature. The patch is against
-r20032 (because -r20033 generates compiler errors in the budget

This patch adds a new option under Edit -> Preferences -> Date/Time
that looks like this:

 Date Completion
 When a date is entered without year, it should be taken:

 (*) In the current calendar year

 ( ) In a sliding 12-month window starting this many months before the
     current month:
     [ 6 ]

I tried to follow the GnuCash coding style and conventions. One thing
I am not sure about is how to tell Guile to set the correct defaults
for the new preferences, i.e., check the first radio box and set the
month to "6", when these are used for the first time. 

Also, I added a static auxiliary math function floordiv(a,b) in
src/libqof/qof/gnc-date.c. I am not sure what is the correct naming
convention and/or location for such a function.

Please let me know what you think. -- Peter

Derek Atkins wrote:
> Hi,
> selinger at (Peter Selinger) writes:
> > A question I always mean to ask this time of year: is there a way to
> > change the default date completion behavior of GnuCash?
> >
> > Today is January 5, 2011. If I enter a transaction with an incomplete
> > date, such as 12/30, GnuCash automatically enters this as 12/30/2011,
> > which is what I want in 0% of cases. 
> >
> > Conversely, last week, when I entered the date 1/5 last week, GnuCash
> > recorded this as 01/05/2010.
> >
> > As a result, around the turn of the year, I constantly have to enter
> > full dates, which is inconvenient.
> >
> > I checked the preferences and could not find a setting for changing
> > this behavior. Is there one? 
> Unfortunately, no, this has not (yet) been implemented. 
> Hopefully someone will decide to scratch this itch.  ;-)
> > Thanks, -- Peter
> > Please remember to CC this list on all your replies.
> > You can do this by using Reply-To-List or Reply-All.
> -derek
> -- 
>        Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>        Member, MIT Student Information Processing Board  (SIPB)
>        URL:    PP-ASEL-IA     N1NWH
>        warlord at MIT.EDU                        PGP key available

-------------- next part --------------
A non-text attachment was scrubbed...
Name: date-completion-patch-r20032.diff
Type: application/octet-stream
Size: 16282 bytes
Desc: ASCII C program text
URL: <>

More information about the gnucash-user mailing list