Last Comment Bug 248808 - Search/filter/mailview: "date", "is after" includes messages on date
: Search/filter/mailview: "date", "is after" includes messages on date
Product: MailNews Core
Classification: Components
Component: Filters (show other bugs)
: Trunk
: All All
-- minor (vote)
: Thunderbird 23.0
Assigned To: :aceman
Depends on:
  Show dependency treegraph
Reported: 2004-06-27 07:08 PDT by
Modified: 2014-02-10 06:12 PST (History)
4 users (show)
acelists: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

patch (2.62 KB, patch)
2013-05-06 15:20 PDT, :aceman
no flags Details | Diff | Splinter Review
patch v2 (2.67 KB, patch)
2013-05-08 14:08 PDT, :aceman
rkent: review+
Details | Diff | Splinter Review
tests (3.48 KB, patch)
2013-05-16 13:57 PDT, :aceman
standard8: review+
Details | Diff | Splinter Review

Description User image 2004-06-27 07:08:05 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.9
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.9

When searching, you can choose to search by date. But searching with date and
"is after", also gives the results of the date you have choosen, even if you
meant "is after".
"Is before" works the right way.

Reproducible: Always
Steps to Reproduce:
1. Open search
2. Choose to search by date.
3. Choose "is after"
4. Type a date, where you know you have recived mails on that date and the date
5. Search

Actual Results:  
If you search for 06-06-2004 (DD-MM-YYYY), the search results will include mails
from 06-06-2004.

Expected Results:  
If you search for 06-06-2004 (DD-MM-YYYY), the search results should include
mails from 07-06-2004, because the "is after" the date typed.

Tested on Thunderbird 0.7 on Windows XP.
Comment 1 User image Wayne Mery (:wsmwk, NI for questions) 2010-09-04 13:48:05 PDT
this still occurs
Comment 2 User image Anje 2013-01-30 05:01:26 PST
Using Thunderbird 17.0.2
Problem still occurs.

Does not accept system date eg:
Date > is after > 28/01/2013
returns everything from 'wed 4/07/12   07:42PM  to current date
Comment 3 User image Anje 2013-01-30 05:39:13 PST
Using windows vista, thunderbird 17.0.2
RE: search Messages:
1. does not search by system date eg: 12/02/2013
2. does not allow search by date and time

if I use eg: 2013/01/12 (no one uses this in UK and my computer is not set to use it and the returned results display as per system eg: Sat 26/01/13 07:30PM)

3. parameter = is after - does not return 'after' but includes that date.
4. parameter = is before - works
Comment 4 User image :aceman 2013-05-06 15:20:38 PDT
Created attachment 746105 [details] [diff] [review]

So the bug was that the logic added 60*60*24 to the time variable to advance one day. However, the time variable was a PRTime which seems to be in nanoseconds. So 60*60*24 did not advance a full day. So that could get fixed by multiplying PR_NSEC_PER_MSEC. However I do not like such hardcoding of logic having assumptions about internal representation of the time. So I rewrote the functions to use the exploded time members which should be more future-proof. But I leave it to rkent to decide what is better.
Comment 5 User image :aceman 2013-05-08 14:08:48 PDT
Created attachment 747117 [details] [diff] [review]
patch v2
Comment 6 User image Kent James (:rkent) 2013-05-08 15:56:23 PDT
Comment on attachment 747117 [details] [diff] [review]
patch v2

I like the version using exploded time everywhere. Thanks.
Comment 7 User image Ryan VanderMeulen [:RyanVM] 2013-05-09 04:34:49 PDT
Comment 8 User image :aceman 2013-05-16 13:57:16 PDT
Created attachment 750679 [details] [diff] [review]

Some tests for the bug.
Comment 9 User image :aceman 2013-11-07 14:49:17 PST
Comment on attachment 750679 [details] [diff] [review]

This patch is not yet reviewed or checked in, but I apologize for adding it after the bug was fixed...
Comment 10 User image Mark Banner (:standard8) 2014-02-10 05:05:04 PST
Comment on attachment 750679 [details] [diff] [review]

Review of attachment 750679 [details] [diff] [review]:

Stealing review to get this closed off. r=Standard8
Comment 11 User image :aceman 2014-02-10 05:11:13 PST
Comment 12 User image Ryan VanderMeulen [:RyanVM] 2014-02-10 06:12:48 PST

Note You need to log in before you can comment on or make changes to this bug.