Skip to content

Commit

Permalink
Derive date format from period start
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Feb 27, 2020
1 parent f6d67db commit 9d693f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/fortuna/ical4j/model/Period.java
Expand Up @@ -129,7 +129,7 @@ public class Period<T extends Temporal> implements Comparable<Period<T>>, Serial
* @param end the end date of the period
*/
public Period(final T start, final T end) {
this(start, end, CalendarDateFormat.FLOATING_DATE_TIME_FORMAT);
this(start, end, CalendarDateFormat.from(start));
}

/**
Expand Down Expand Up @@ -181,7 +181,7 @@ public Period(final T start, final TemporalAmount duration, CalendarDateFormat d
* @param duration the duration of the period
*/
private Period(final T start, final TemporalAmountAdapter duration) {
this(start, duration, CalendarDateFormat.FLOATING_DATE_TIME_FORMAT);
this(start, duration, CalendarDateFormat.from(start));
}

/**
Expand Down

0 comments on commit 9d693f3

Please sign in to comment.