提问人:developer 提问时间:7/20/2023 最后编辑:developer 更新时间:7/21/2023 访问量:49
遍历 LocalDate 范围 groovy 列表
Iterating through LocalDate range groovy list
问:
这曾经在 Groovy 3.x 版本下工作,但在 4.x 中失败
LocalDate startDate = LocalDate.of(2023, Month.JULY, 1)
LocalDate endDate = LocalDate.of(2023, Month.JULY, 31)
LocalDate[] businessDates = (startDate..endDate).collect()
businessDates.stream().forEach { print it }
Caught: groovy.lang.MissingMethodException:
No signature of method: java.time.LocalDate.next() is applicable for argument types: () values: []
Possible solutions: get(java.time.temporal.TemporalField), wait(), now(), wait(long), now(java.time.Clock), now(java.time.ZoneId)
groovy.lang.MissingMethodException:
No signature of method: java.time.LocalDate.next() is applicable for argument types: () values: []
Possible solutions: get(java.time.temporal.TemporalField), wait(), now(), wait(long), now(java.time.Clock), now(java.time.ZoneId)
at Main.run(Main.groovy:4)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
关于如何解决这个问题的任何想法?
答: 暂无答案
评论