changed the method to get the date for validating the visit dates which was returning an object instead of a string