<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi Neil,</p>
    <p>IMO duplicate instances generated from an RRULE should be handled
      just like RRULE instances for which an RDATE exists. You merge
      them into one. RFC 5545 speaks of a "recurrence set" and "a set is
      a collection of distinct objects"
      (<a class="moz-txt-link-freetext" href="https://en.wikipedia.org/wiki/Set_(mathematics)">https://en.wikipedia.org/wiki/Set_(mathematics)</a> ). So by
      definition the recurrence set can not contain two equal instances.
      This should answer 1 and 2.</p>
    <p>Regarding 3, see the table on page 7
      (<a class="moz-txt-link-freetext" href="https://tools.ietf.org/html/rfc7529#page-7">https://tools.ietf.org/html/rfc7529#page-7</a>)<br>
    </p>
    <p>   o  BYMONTH<br>
         o  SKIP (for invalid month only)<br>
         o  BYWEEKNO<br>
         o  BYYEARDAY<br>
         o  BYMONTHDAY<br>
         o  SKIP (for invalid day)<br>
         o  BYDAY<br>
         o  BYHOUR<br>
         o  BYMINUTE<br>
         o  BYSECOND<br>
         o  BYSETPOS<br>
         o  COUNT<br>
         o  UNTIL<br>
    </p>
    <p>It says that SKIP is applied before BYSETPOS. So In your example
      2001-02-30 and 2001-02-31 would both wrap around to 2001-03-01
      which becomes the 2nd instance of this particular set (even though
      it's in the next month), and also happens to be the first instance
      of the "March Set". So in this case 3 instances are merged into
      one.<br>
    </p>
    <p>That's my interpretation and how I intended to implemented it.
      However, I've just noticed that we return 2001-03-01 twice, which
      is not correct. I'll fix that.<br>
    </p>
    <p>Cheers,</p>
    <p>Marten<br>
    </p>
    <div class="moz-cite-prefix">Am 19.10.18 um 06:23 schrieb Neil
      Jenkins:<br>
    </div>
    <blockquote type="cite"
      cite="mid:ab09c5ef-8184-4959-8b1b-26befdb84ea7@sloti22d1t06">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <title></title>
      <style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style>
      <div>Hi everyone,<br>
      </div>
      <div><br>
      </div>
      <div>I'm trying to extend the <a
href="https://tools.ietf.org/html/draft-ietf-calext-jscalendar-08#section-4.3.1"
          moz-do-not-send="true">JSCalendar recurrence rule expansion
          algorithm</a> to accommodate <a
          href="https://tools.ietf.org/html/rfc7529#section-4.1"
          moz-do-not-send="true">RFC7529</a> and support RSCALE and
        SKIP. The former is easy, the latter seems to be a real pain.
        One big problem I'm running into is that the RFC seems to be
        quite under-specified when it comes to any kind of edge cases.
        So, can anyone help answer a few questions (presume <code
          style="border-radius:3px;border:1px solid #ccc;padding:1px
3px;background:#f6f6f6;font-family:menlo,consolas,monospace;font-size:90%;">DTSTART=20010201</code>
        for all of these):<br>
      </div>
      <div><br>
      </div>
      <ol>
        <li>What happens if I generate duplicates due to SKIP; should
          they be removed, or considered separate occurrences? e.g. <code
            style="border-radius:3px;border:1px solid #ccc;padding:1px
3px;background:#f6f6f6;font-family:menlo,consolas,monospace;font-size:90%;">RSCALE=GREGORIAN;FREQ=YEARLY;BYMONTH=2,3;BYMONTHDAY=1,31;SKIP=FORWARD</code>.
          I presume that should not generate two instances of 2001-03-01
          despite this being the result of <code
            style="border-radius:3px;border:1px solid #ccc;padding:1px
3px;background:#f6f6f6;font-family:menlo,consolas,monospace;font-size:90%;">BYMONTH=2;BYMONTHDAY=31;SKIP=FORWARD</code>
          as well as <code style="border-radius:3px;border:1px solid
            #ccc;padding:1px
3px;background:#f6f6f6;font-family:menlo,consolas,monospace;font-size:90%;">BYMONTH=3;BYMONTHDAY=1</code>.<br>
        </li>
        <li>What about if the duplicates occur in different periods,
          e.g. <code style="border-radius:3px;border:1px solid
            #ccc;padding:1px
3px;background:#f6f6f6;font-family:menlo,consolas,monospace;font-size:90%;">RSCALE=GREGORIAN;FREQ=MONTHLY;BYMONTHDAY=1,31;SKIP=FORWARD</code>
          – should they still be removed?<br>
        </li>
        <li>How does this interact with <code
            style="border-radius:3px;border:1px solid #ccc;padding:1px
3px;background:#f6f6f6;font-family:menlo,consolas,monospace;font-size:90%;">BYSETPOS</code>?
          Are the duplicates removed before or after applying this? For
          example, <code style="border-radius:3px;border:1px solid
            #ccc;padding:1px
3px;background:#f6f6f6;font-family:menlo,consolas,monospace;font-size:90%;">RSCALE=GREGORIAN;FREQ=MONTHLY;BYMONTHDAY=1,30,31;BYSETPOS=1,2;SKIP=FORWARD</code>
          – this might evaluate to 2001-02-01, 2001-02-30, 2001-02-31.
          We apply bySetPos and dedup (in either order) and get
          2001-02-01, 2001-03-01. OK, now we continue to March. is
          2001-03-01 considered for part of the <code
            style="border-radius:3px;border:1px solid #ccc;padding:1px
3px;background:#f6f6f6;font-family:menlo,consolas,monospace;font-size:90%;">BYSETPOS</code> (so
          you get just 2001-03-30)? Or because it's already been
          generated from the Feb candidates due to the SKIP rule, is it
          eliminated before applying <code
            style="border-radius:3px;border:1px solid #ccc;padding:1px
3px;background:#f6f6f6;font-family:menlo,consolas,monospace;font-size:90%;">BYSETPOS</code> (so
          you get 2001-03-30 and 2001-03-31)?<br>
        </li>
      </ol>
      <div><br>
      </div>
      <div>Looking forward to being enlightened on this,<br>
      </div>
      <div><br>
      </div>
      <div>Neil.</div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
caldeveloper-l mailing list
<a class="moz-txt-link-abbreviated" href="mailto:caldeveloper-l@lists.calconnect.org">caldeveloper-l@lists.calconnect.org</a>
<a class="moz-txt-link-freetext" href="http://lists.calconnect.org/listinfo.cgi/caldeveloper-l-calconnect.org">http://lists.calconnect.org/listinfo.cgi/caldeveloper-l-calconnect.org</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Marten Gajda
CEO

dmfs GmbH
Schandauer Straße 34
01309 Dresden
GERMANY

phone: +49 177 4427167
email: <a class="moz-txt-link-abbreviated" href="mailto:marten@dmfs.org">marten@dmfs.org</a>

Managing Director: Marten Gajda
Registered address: Dresden
Registered No.: AG Dresden HRB 34881
VAT Reg. No.: DE303248743</pre>
  </body>
</html>