comparing dates instead of times on the calendar, so that maxDate can be selected