+static struct time_criterion time_criteria[] = {
+
+ { "8h", 8, -1, -1 },
+ { "today", 24, -1, -1 },
+ { "24h", 24, -1, -1 },
+ { "48h", 48, -1, -1 },
+ { "week", 24 * 7, -1, -1 },
+ { "month", 24 * 31, -1, -1 },
+ { "year", 24 * 365, -1, -1 },
+
+ { "yesterday", 48, 24, -1 },
+
+ { "monday", -1, -1, 1 },
+ { "tuesday", -1, -1, 2 },
+ { "wednesday", -1, -1, 3 },
+ { "thursday", -1, -1, 4 },
+ { "friday", -1, -1, 5 },
+ { "saturday", -1, -1, 6 },
+ { "sunday", -1, -1, 7 },
+
+};
+
+/*********************************************************************/
+
+time_t time_for_past_day(int day) {
+ time_t t;
+ struct tm *tm;
+ int delta_day;
+ t = time(0);
+ tm = localtime(&t);
+ delta_day = (7 + tm->tm_wday - day) % 7;
+ if(delta_day == 0) { delta_day = 7; }
+ return t - (delta_day * 3600 * 24 + tm->tm_sec + 60 * tm->tm_min + 3600 * tm->tm_hour);
+}
+
+void init_condition(struct search_condition *condition, const char *full_string,
+ const char *default_search_field) {