Skip to content

Commit

Permalink
Removed dependency on temporal adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Dec 7, 2020
1 parent cfcbb95 commit a8bde59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
@@ -1,6 +1,5 @@
package net.fortuna.ical4j.transform.recurrence;

import net.fortuna.ical4j.model.TemporalAdapter;
import net.fortuna.ical4j.transform.Transformer;

import java.io.Serializable;
Expand Down Expand Up @@ -128,8 +127,7 @@ private int getTemporalField(T date, TemporalField field) {
if (date.isSupported(field)) {
return date.get(field);
} else {
ZonedDateTime zonedDateTime = new TemporalAdapter<>(date).toLocalTime();
return zonedDateTime.get(field);
return ZonedDateTime.from(date).get(field);
}
}

Expand Down
Expand Up @@ -14,7 +14,7 @@ class ByDayRuleTest extends Specification {

def 'verify transformations by day'() {
given: 'a BYDAY rule'
ByDayRule rule = [new WeekDayList(rulePart), frequency, DayOfWeek.SUNDAY]
ByDayRule rule = [new WeekDayList((WeekDay) rulePart), frequency, DayOfWeek.SUNDAY]

and: 'a list of dates'
def dates = []
Expand Down

0 comments on commit a8bde59

Please sign in to comment.