condition->negation = 0;
}
- if(strcmp(search_field, "6h") == 0) {
+ /* Last 8 hours */
+
+ if(strcmp(search_field, "8h") == 0) {
condition->field_id = ID_INTERVAL;
- condition->interval_start = time(0) - 3600 * 6;
+ condition->interval_start = time(0) - 3600 * 8;
condition->interval_stop = 0;
}
+ /* Today and yesterday */
+
else if(strcmp(search_field, "24h") == 0 ||
strcmp(search_field, "today") == 0) {
condition->field_id = ID_INTERVAL;
condition->interval_stop = 0;
}
+ else if(strcmp(search_field, "yesterday") == 0) {
+ condition->field_id = ID_INTERVAL;
+ condition->interval_start = time(0) - 2 * 3600 * 24;
+ condition->interval_stop = condition->interval_start + 3600 * 24;
+ }
+
+ /* Week days */
+
else if(strcmp(search_field, "monday") == 0) {
condition->field_id = ID_INTERVAL;
condition->interval_start = time_for_past_day(1);
condition->interval_stop = condition->interval_start + 3600 * 24;
}
- else if(strcmp(search_field, "yesterday") == 0) {
- condition->field_id = ID_INTERVAL;
- condition->interval_start = time(0) - 2 * 3600 * 24;
- condition->interval_stop = condition->interval_start + 3600 * 24;
- }
-
else {
condition->field_id = -1;