[GNC-dev] Bug 796725
John Ralls
jralls at ceridwen.us
Wed Aug 15 09:43:37 EDT 2018
I was actually thinking of date ranges on report options, but yeah, having both “before” and “on or before” seems redundant.
Regards,
John Ralls
> On Aug 15, 2018, at 2:47 AM, Robert Fewell <14ubobit at gmail.com> wrote:
>
> So really in the FIND dialogue the Date find option only needs two or three possibilities....
>
> "is before or on" using gnc_dmy2time64_end() to change entry date to 23:59:59
> "is on" with the QofDateMatch set to QOF_DATE_MATCH_DAY ( this changes the compared dates with 'time64CanonicalDayTime' )
> "is on or after" using gnc_dmy2time64() to change entry date to 00:00:00
>
> Regards,
> Bob
>
> On 14 August 2018 at 16:02, John Ralls <jralls at ceridwen.us <mailto:jralls at ceridwen.us>> wrote:
>
>
> > On Aug 14, 2018, at 6:55 AM, Robert Fewell <14ubobit at gmail.com <mailto:14ubobit at gmail.com>> wrote:
> >
> > I have been looking at this one and know what is wrong but not sure if my
> > fix is valid.
> >
> > It is to do with searching for transactions by posted date and returning
> > the wrong number of transactions for the required filter option.
> >
> > When the date entered in the GtkEntry, gnc_date_edit_get_date returns the
> > time64 but at 12:00:00 am for that day.
> >
> > Looking at the transaction posted date in my Xml file they are at
> > '2018-01-01 10:59:00 +0000'
> >
> > I can fix this in search-date.c by changing the two occurrences of
> > gnc_date_edit_get_date to some thing like this...
> >
> > time64 temp = gnc_date_edit_get_date (GNC_DATE_EDIT (priv->entry));
> > struct tm * temp_tm = gnc_localtime (&temp);
> >
> > fi->tt = gnc_dmy2time64_neutral (temp_tm->tm_mday, temp_tm->tm_mon
> > + 1, temp_tm->tm_year + 1900);
> > gnc_tm_free (temp_tm);
> >
> > but this would affect all date searches in transactions, invoices and bills.
> >
> > Should all dates be at this neutral time so it does not matter ?
>
> Bob,
>
> I think all search dates should be “open” intervals, meaning that if you search from 1 - 31 January, the result set should include transactions on both 1 January and 31 January as well as everything in between. The best way to accomplish this is to use gnc_dmy2time64() for the beginning of the search and gnc_dmy2time64_end() for the end of the search: The former returns 00:00:00 on the day and the latter to 23:59:59.
>
> Transaction *posted* dates created with 2.6.12 or so and later are set to 10:59:00 UTC using gnc_dmy2time64_neutral() unless the user is in one of the “edge” timezones, -12, +13, or +14, in which cases the time is offset to keep the time in the same local day. Other dates, e.g. date_entered and date_reconciled, are set to the actual time that the action occurred, usually using gnc_time().
>
> Regards,
> John Ralls
>
>
More information about the gnucash-devel
mailing list