title: Calendar. Recurrent event occurrence. How to check if start date matched on pattern?
body: <p>If I use google library <a href="https://mvnrepository.com/artifact/org.scala-saddle/google-rfc-2445/20110304" rel="nofollow noreferrer"><em>google-rfc-2445</em></a> (to calculate occurrences)</p>
  <pre><code>String sRule = &quot;RRULE:FREQ=YEARLY;COUNT=3;INTERVAL=2;BYMONTH=5;BYMONTHDAY=22,23,24,25,26,27,28;BYDAY=MO&quot;;
  LocalDateIterable localDateIterable = LocalDateIteratorFactory
              .createLocalDateIterable(sRule, org.joda.time.LocalDate.now(), true);
  LocalDateIterator iterator = localDateIterable.iterator();
  iterator.forEachRemaining(System.out::println);
  </code></pre>
  <p>I'll get in result:</p>
  <blockquote>
  <p>2017-07-17</p>
  <p>2019-05-27</p>
  <p>2021-05-24</p>
  <p>2023-05-22</p>
  </blockquote>
  <p>considering pattern, there are should be only 3 dates. Considering each one we can find that first one is redundant. I have no marker if start date is valid or not. And as you see first one isn't. (If I use correct start date creating iterable I would get 3 correct dates in result.)</p>
  <p>Similar experiment with <em><a href="https://github.com/dmfs/lib-recur" rel="nofollow noreferrer">lib-recur</a></em> (result almost similar with small differences)</p>
  <pre><code>RecurrenceRule recurrenceRule = new RecurrenceRule(&quot;FREQ=YEARLY;BYMONTHDAY=23;BYMONTH=5;COUNT=3&quot;);
  RecurrenceRuleIterator it = recurrenceRule.iterator(DateTime.nowAndHere());
  int maxInstances = 10; // limit instances for rules that recur forever
  while (it.hasNext() &amp;&amp; (!recurrenceRule.isInfinite() || maxInstances-- &gt; 0)) {
      DateTime nextInstance = it.nextDateTime();
      System.out.println(nextInstance);
  }
  </code></pre>
  <p>Result count is correct, but first occurrence isn't. Correctness of first occurrence depends on (if start date is correct first occurrence also would be correct)...</p>
  <blockquote>
  <p>20170717T123104</p>
  <p>20190527T123104</p>
  <p>20210524T123104</p>
  </blockquote>
  <p>How I could specify or validate start date in correct way using <a href="https://mvnrepository.com/artifact/org.scala-saddle/google-rfc-2445/20110304" rel="nofollow noreferrer"><em>google-rfc-2445</em></a> or <em><a href="https://github.com/dmfs/lib-recur" rel="nofollow noreferrer">lib-recur</a></em>?</p>