From: Francois Fleuret Date: Wed, 6 Feb 2013 08:02:51 +0000 (+0100) Subject: Added the "week" search criterion. X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=mymail.git;a=commitdiff_plain;h=0ea4d09380ffcc4063d2fed55078f91ff59e72fa Added the "week" search criterion. --- diff --git a/mymail.1 b/mymail.1 index 2ba2122..62d6def 100644 --- a/mymail.1 +++ b/mymail.1 @@ -99,6 +99,8 @@ entirely. .TP \fBtoday\fR, \fB24h\fR selects mails received during the last 24 hours. .TP +\fBweek\fR selects mails received during the last 7*24 hours. +.TP \fByesterday\fR selects mails received between 48h and 24h ago. .TP \fBmonday\fR, \fBtuesday\fR, ..., \fBsunday\fR selects mails received diff --git a/mymail.c b/mymail.c index bac2f45..0e9009a 100644 --- a/mymail.c +++ b/mymail.c @@ -710,6 +710,12 @@ void init_condition(struct search_condition *condition, char *string) { condition->interval_stop = 0; } + else if(strcmp(search_field, "week") == 0) { + condition->field_id = ID_INTERVAL; + condition->interval_start = time(0) - 3600 * 24 * 7; + condition->interval_stop = 0; + } + /* Today and yesterday */ else if(strcmp(search_field, "24h") == 0 || @@ -834,6 +840,7 @@ int main(int argc, char **argv) { paranoid = 0; action_index = 0; db_filename = 0; + db_filename_regexp_string = 0; db_root_path = 0; db_filename_list = 0; quiet = 0;