correct condition on dates