Fix apoint_inday() with long appointments

Fixes a regression introduced in 9e160fa (Do not assume that days always
have 86400 seconds, 2016-03-27).

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer 2016-03-28 08:45:49 +02:00
parent 9e160fac16
commit 4633846550

View File

@ -119,7 +119,8 @@ struct apoint *apoint_new(char *mesg, char *note, long start, long dur,
unsigned apoint_inday(struct apoint *i, long *start)
{
return (date_cmp_day(i->start, *start) == 0);
return (date_cmp_day(i->start, *start) <= 0 &&
date_cmp_day(i->start + i->dur - 1, *start) >= 0);
}
void apoint_sec2str(struct apoint *o, long day, char *start, char *end)