added date types to max function