Added input validations for the dates