small edits to isValidDateRange