|
|
@@ -1,7 +1,5 @@
|
|
|
package cn.iocoder.yudao.module.iscs.utils;
|
|
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-
|
|
|
import java.time.DayOfWeek;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.YearMonth;
|
|
|
@@ -327,10 +325,7 @@ public class SuperDateUtils {
|
|
|
}
|
|
|
currentYear += frequencyYears; // 按频率递增年份
|
|
|
}
|
|
|
- List<String> list = result.subList(0, Math.min(count, result.size()));
|
|
|
- if (StringUtils.isNotBlank(endDateStr)) {
|
|
|
- list.removeIf(item -> LocalDate.parse(item, formatter).isAfter(LocalDate.parse(endDateStr, formatter)));
|
|
|
- }return list;
|
|
|
+ return result.subList(0, Math.min(count, result.size()));
|
|
|
}
|
|
|
|
|
|
private static LocalDate getValidDateForYear(int year, int dayOfYear) {
|
|
|
@@ -345,7 +340,7 @@ public class SuperDateUtils {
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
// 示例测试:查找2025-07-24之后,每年第250天的日期,最多10个
|
|
|
- List<String> dates = getAdjacentDates("2025-07-24", 1, 206, 10, "2029-07-24");
|
|
|
+ List<String> dates = getAdjacentDates("2025-07-24", 1, 206, 10, "2029-07-25");
|
|
|
System.out.println("结果:" + dates);
|
|
|
// 预期输出应包含2028-09-07(若250天合法)
|
|
|
}
|