validatedate 

CF

Function validateDate 

The function/method validateDate accepts an argument dateStr representing a string value which contains a date in the format…