Prevent user from add a task that has passed

Refactored logic test to fit the problem