Fesod version
Current main at 5a9a16b.
Description
Automatic date-format detection supports slash-separated date-time strings, but a 10-character date is always assigned yyyy-MM-dd. Consequently, yyyy/MM/dd fails unless the user supplies an explicit @DateTimeFormat.
Location
fesod-sheet/src/main/java/org/apache/fesod/sheet/util/DateUtils.java:184-205
Reproduction
DateUtils.parseLocalDate("2024/01/02", null, Locale.US);
// DateTimeParseException
DateUtils.parseLocalDateTime("2024/01/02 03:04:05", null, Locale.US);
// succeeds
switchDateFormat("2024/01/02") returns yyyy-MM-dd, while the 16- and 19-character branches already select slash-specific formats.
Expected behavior
The default parser should accept yyyy/MM/dd consistently with the supported slash-separated date-time formats.
Suggested fix
Add a yyyy/MM/dd format constant, select it for 10-character strings containing /, and add Date/LocalDate converter tests.
Related existing work
#1040 concerns locale handling for java.util.Date; it does not cover delimiter detection.
Are you willing to submit a PR?
Yes.
Fesod version
Current
mainat5a9a16b.Description
Automatic date-format detection supports slash-separated date-time strings, but a 10-character date is always assigned
yyyy-MM-dd. Consequently,yyyy/MM/ddfails unless the user supplies an explicit@DateTimeFormat.Location
fesod-sheet/src/main/java/org/apache/fesod/sheet/util/DateUtils.java:184-205Reproduction
switchDateFormat("2024/01/02")returnsyyyy-MM-dd, while the 16- and 19-character branches already select slash-specific formats.Expected behavior
The default parser should accept
yyyy/MM/ddconsistently with the supported slash-separated date-time formats.Suggested fix
Add a
yyyy/MM/ddformat constant, select it for 10-character strings containing/, and add Date/LocalDate converter tests.Related existing work
#1040 concerns locale handling for
java.util.Date; it does not cover delimiter detection.Are you willing to submit a PR?
Yes.