Check date is valid