Skip to content

Commit

Permalink
Attempt to fix github issue#99, inclusive Recur
Browse files Browse the repository at this point in the history
  • Loading branch information
artheus authored and benfortuna committed Dec 14, 2018
1 parent b474a6e commit 13dfe06
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main/java/net/fortuna/ical4j/model/Recur.java
Expand Up @@ -713,17 +713,14 @@ public final DateList getDates(final Date seed, final Date periodStart,

if (getUntil() != null && candidate != null
&& candidate.after(getUntil())) {

break;
}
if (periodEnd != null && candidate != null
&& candidate.after(periodEnd)) {

break;
}
if (getCount() >= 1
&& (dates.size() + invalidCandidates.size()) >= getCount()) {

break;
}

Expand Down Expand Up @@ -751,13 +748,15 @@ public final DateList getDates(final Date seed, final Date periodStart,
if (!candidate.before(seed)) {
// candidates exclusive of periodEnd..
if (candidate.before(periodStart)
|| !candidate.before(periodEnd)) {
|| candidate.after(periodEnd)) {
invalidCandidates.add(candidate);
} else if (getCount() >= 1
&& (dates.size() + invalidCandidates.size()) >= getCount()) {
break;
} else if (!(getUntil() != null
&& candidate.after(getUntil()))) {
} else if (getUntil() instanceof Date
&& candidate.compareTo(getUntil()) < 1) {
dates.add(candidate);
} else if (!candidate.before(periodStart) && candidate.before(periodEnd)) {
dates.add(candidate);
}
}
Expand Down

0 comments on commit 13dfe06

Please sign in to comment.