YiwenWu commented on code in PR #238:
URL: https://github.com/apache/calcite-avatica/pull/238#discussion_r1529579227
##########
core/src/main/java/org/apache/calcite/avatica/util/DateTimeUtils.java:
##########
@@ -739,6 +744,25 @@ private static int parseFraction(String v, int multiplier)
{
return r;
}
+ /** Lenient date validation. This accepts more date strings
+ * than validateDate: it does not insist on having two-digit
+ * values for days and months, and accepts spaces around the value.
+ * @param s A string representing a date.
+ */
+ private static void validateLenientDate(String s) {
Review Comment:
There is no problem using this method to verify, but this implementation
only verifies `DAY`. Is it possible to use a more general verification method,
such as:
```
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
try {
LocalDate date = LocalDate.parse(dateString, formatter);
return true;
} catch (DateTimeParseException e) {
return false;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]