I have already checked this post and this post but their answers didn\'t work with my question. I have a function that checks if the date string taken from the user is valid