GNOME Bugzilla – Bug 211058
filter for 'x time in future' instead of past
Last modified: 2007-05-11 05:56:58 UTC
Package: Evolution Priority: Normal Version: cvs.2001.0925.08.08 Synopsis: comparing time in filters Bugzilla-Product: Evolution Bugzilla-Component: Mailer Description: If date sent was after 1 month ago? umm.. how can I say if it is more than so long in the future? I hate getting mail with bad dates, so I am trying to write a filter that kills it.
Would be handy at times.
*** bug 235160 has been marked as a duplicate of this bug. ***
adding "filters" keyword
Created attachment 64427 [details] [review] Update a table in an attempt to do future date filtering I may not be reading the code correctly. However, I believe I am. If I am, there just needs to be translation updates with this patch and all functionality will be present.
Is this as simple as changing (in /evolution/filter/filter-datespec.c): static const timespan timespans[] = { { 1, ngettext("1 second ago", "%d seconds ago"), 59.0 }, { 60, ngettext("1 minute ago", "%d minutes ago"), 59.0 }, { 3600, ngettext("1 hour ago", "%d hours ago"), 23.0 }, { 86400, ngettext("1 day ago", "%d days ago"), 31.0 }, { 604800, ngettext("1 week ago", "%d weeks ago"), 52.0 }, { 2419200, ngettext("1 month ago", "%d months ago"), 12.0 }, { 31557600, ngettext("1 year ago", "%d years ago"), 1000.0 }, }; to static const timespan timespans[] = { { 1, ngettext("1 second ago", "%d seconds ago"), 59.0 }, { 60, ngettext("1 minute ago", "%d minutes ago"), 59.0 }, { 3600, ngettext("1 hour ago", "%d hours ago"), 23.0 }, { 86400, ngettext("1 day ago", "%d days ago"), 31.0 }, { 604800, ngettext("1 week ago", "%d weeks ago"), 52.0 }, { 2419200, ngettext("1 month ago", "%d months ago"), 12.0 }, { 31557600, ngettext("1 year ago", "%d years ago"), 1000.0 }, { -1, ngettext("1 second in the future", "%d seconds in the future"), 59.0 }, { -60, ngettext("1 minute in the future", "%d minutes in the future"), 59.0 }, { -3600, ngettext("1 hour in the future", "%d hours in the future"), 23.0 }, { -86400, ngettext("1 day in the future", "%d days in the future"), 31.0 }, { -604800, ngettext("1 week in the future", "%d weeks in the future"), 52.0 }, { -2419200, ngettext("1 month in the future", "%d months in the future"), 12.0 }, { -31557600, ngettext("1 year in the future", "%d years in the future"), 1000.0 }, }; It seems to me that it would be. However, I always have problems compiling evolution CVS so I cannot try it. Would someone mind trying it. I have attached a patch. Of course, translations would be needed. I think I am reading this code right, but I might not be.
Changing version to 2.6.x as this bug is still present. Has been a bug since 1.5.x.
This patch as is is completely bogus. I am working on a new one outside of this bug report.
Ok, I learned a lot by seeing how my previous patch didn't work. I had a learning curve with rpmbuild (namely that you can't build rpms with the short circuit feature). Having spent hours from that here are my comments: I will be submitting a patch. It has one hack in set_values function due to the hack to provide a history. It is much better than my other methods that required abs or other ways of doing abs. This one is safe for all platforms as written, I believe, and only requires one hack, versus several if done another way. The patch is attached. I will be submitting it to the evolution patches mailing list. I have this patch in the redhat rawhide bugzilla. Bug 190359. They may be including it in rawhide for further testing. I have tested it for both future and past dates, everything works for me.
Created attachment 68141 [details] [review] Tested patch for adding future dates instead of just "ago" Sorry for some of the diff spam, this is due to me using glade-2 to do a few necessary changes. This does not include any translation updates - they are needed!
This patch catches most of the spam that spamassassin does not for me because a good deal of the spam I get is from the future. Is there anyway this patch can be integrated. I have been using it now for about 2 weeks without any problems and with 100% success.
This patch has now been integrated (as of July 12, 2006) into Redhat Rawhide. I would like to see some testing by others here and inclusion when appropriate.
Committed in svn trunk for 2.11.2