Closed Bug 248808 Opened 17 years ago Closed 8 years ago

Search/filter/mailview: "date", "is after" includes messages on date

Categories

(MailNews Core :: Filters, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 23.0

People

(Reporter: anders, Assigned: aceman)

Details

Attachments

(2 files, 1 obsolete file)

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
after.
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.
Severity: normal → trivial
Status: UNCONFIRMED → NEW
Component: General → MailNews: Filters
Ever confirmed: true
Product: Thunderbird → Core
Summary: Search, "date", "is after" gives wrong result → Search/filter/mailview: "date", "is after" includes messages on date
Version: unspecified → Trunk
Assignee: mscott → nobody
QA Contact: filters
Product: Core → MailNews Core
this still occurs
Severity: trivial → minor
Using Thunderbird 17.0.2
Problem still occurs.

additional:
Does not accept system date eg:
Date > is after > 28/01/2013
returns everything from 'wed 4/07/12   07:42PM  to current date
Additional:
Using windows vista, thunderbird 17.0.2
RE: search Messages:
Note:
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
Attached patch patch (obsolete) — Splinter 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.
Assignee: nobody → acelists
Status: NEW → ASSIGNED
Attachment #746105 - Flags: review?(kent)
OS: Windows XP → All
Hardware: x86 → All
Attached patch patch v2Splinter Review
Attachment #746105 - Attachment is obsolete: true
Attachment #746105 - Flags: review?(kent)
Attachment #747117 - Flags: review?(kent)
Comment on attachment 747117 [details] [diff] [review]
patch v2

I like the version using exploded time everywhere. Thanks.
Attachment #747117 - Flags: review?(kent) → review+
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/4e6e804b478d
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 23.0
Attached patch testsSplinter Review
Some tests for the bug.
Attachment #750679 - Flags: review?(kent)
Attachment #750679 - Flags: review?(kent)
Comment on attachment 750679 [details] [diff] [review]
tests

This patch is not yet reviewed or checked in, but I apologize for adding it after the bug was fixed...
Attachment #750679 - Flags: review?(kent)
Comment on attachment 750679 [details] [diff] [review]
tests

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

Stealing review to get this closed off. r=Standard8
Attachment #750679 - Flags: review?(kent) → review+
Thanks!
Flags: in-testsuite+
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.