Use correct granularity when checking if a task is overdue

Fixes #2281.