summaryrefslogtreecommitdiffstats
path: root/src/recur.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/recur.c')
-rw-r--r--src/recur.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/recur.c b/src/recur.c
index 667ecdf..2fa2d03 100644
--- a/src/recur.c
+++ b/src/recur.c
@@ -403,7 +403,7 @@ struct recur_event *recur_event_scan(FILE * f, struct tm start, int id,
struct item_filter *filter)
{
char buf[BUFSIZ], *nl;
- time_t tstart, tuntil;
+ time_t tstart, tend, tuntil;
EXIT_IF(!check_date(start.tm_year, start.tm_mon, start.tm_mday) ||
!check_time(start.tm_hour, start.tm_min) ||
@@ -434,6 +434,7 @@ struct recur_event *recur_event_scan(FILE * f, struct tm start, int id,
}
tstart = mktime(&start);
EXIT_IF(tstart == -1 || tuntil == -1, _("date error in event"));
+ tend = tstart + DAYINSEC - 1;
/* Filter item. */
if (filter) {
@@ -445,6 +446,10 @@ struct recur_event *recur_event_scan(FILE * f, struct tm start, int id,
return NULL;
if (filter->start_to >= 0 && tstart > filter->start_to)
return NULL;
+ if (filter->end_from >= 0 && tend < filter->end_from)
+ return NULL;
+ if (filter->end_to >= 0 && tend > filter->end_to)
+ return NULL;
}
return recur_event_new(buf, note, tstart, id, recur_char2def(type),