Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static Integer parseDateExpressionToInt(String dateExpression) {
throw new DateTimeParseException(
"Invalid date format. Please use YYYY-MM-DD format.", dateExpression, 0);
}
if (date.getYear() < 1000) {
if (date.getYear() < 1000 || date.getYear() > 9999) {
throw new DateTimeParseException("Year must be between 1000 and 9999.", dateExpression, 0);
}
return date.getYear() * 10000 + date.getMonthValue() * 100 + date.getDayOfMonth();
Expand All @@ -58,7 +58,7 @@ public static Integer parseDateExpressionToInt(LocalDate localDate) {
if (localDate == null) {
throw new DateTimeParseException("Date expression is null or empty.", "", 0);
}
if (localDate.getYear() < 1000) {
if (localDate.getYear() < 1000 || localDate.getYear() > 9999) {
throw new DateTimeParseException(
"Year must be between 1000 and 9999.",
localDate.format(DateTimeFormatter.ISO_LOCAL_DATE),
Expand Down