competitions: Fix detection of the series nearest deadline and first after deadline