Modfied logic for task date validation