java.time.temporal.UnsupportedTemporalTypeException: Unsupported unit: Weeks #805
Replies: 4 comments 4 replies
-
Same thing is happening with monthly events on the calendar. RRULE example:
Getting the following error:
|
Beta Was this translation helpful? Give feedback.
-
Appears error was introduced in 4.0.7 |
Beta Was this translation helpful? Give feedback.
-
@benfortuna Will this be fixed? |
Beta Was this translation helpful? Give feedback.
-
You should always use generics with Recur instances since v4, as some Temporal types won't be supported depending on the rule. e.g. Recur<ZonedDateTime> recurence = new Recur.Builder<ZonedDateTime>()
.frequency(Frequency.WEEKLY)
.dayList(List.of(WeekDay.MO, WeekDay.TU, WeekDay.WE, WeekDay.TH, WeekDay.FR))
.interval(2)
.until(OffsetDateTime.of(2100, 1, 23, 0, 0, 0, 0, ZoneOffset.UTC))
.build(); and the input to e.g. Set<Period<Temporal>> calculateRecurrenceSet = event.calculateRecurrenceSet(
new Period<>(ZonedDateTime.now().minusYears(1), ZonedDateTime.now().plusYears(1))); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
When using the newest version (4.0.8) the Exception:
java.time.temporal.UnsupportedTemporalTypeException: Unsupported unit: Weeks
occurs.
Using Instants leads to the Exception
To Reproduce
see https://github.com/KaiSuchomel/quarkus-test/tree/ical4j for reproducer.
Expected behavior
With version 4.0.6 the Tests passed.
Environment:
Beta Was this translation helpful? Give feedback.
All reactions