Added ability to check if a date is valid or not.