<!DOCTYPE html><html><head><title></title><style type="text/css">#fastmail-quoted #fastmail-quoted-fastmail-quoted p.fastmail-quoted-fastmail-quoted-MsoNormal,#fastmail-quoted  #fastmail-quoted-fastmail-quoted li.fastmail-quoted-fastmail-quoted-MsoNormal,#fastmail-quoted  #fastmail-quoted-fastmail-quoted div.fastmail-quoted-fastmail-quoted-MsoNormal{margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:"Times New Roman", serif;color:black;}
#fastmail-quoted #fastmail-quoted-fastmail-quoted a:link,#fastmail-quoted  #fastmail-quoted-fastmail-quoted span.fastmail-quoted-fastmail-quoted-MsoHyperlink{color:blue;text-decoration-line:underline;text-decoration-style:initial;text-decoration-color:initial;}
#fastmail-quoted #fastmail-quoted-fastmail-quoted a:visited,#fastmail-quoted  #fastmail-quoted-fastmail-quoted span.fastmail-quoted-fastmail-quoted-MsoHyperlinkFollowed{color:purple;text-decoration-line:underline;text-decoration-style:initial;text-decoration-color:initial;}
#fastmail-quoted #fastmail-quoted-fastmail-quoted p{margin-right:0in;margin-left:0in;font-size:12pt;font-family:"Times New Roman", serif;color:black;}
#fastmail-quoted #fastmail-quoted-fastmail-quoted code{font-family:"Courier New";}
#fastmail-quoted #fastmail-quoted-fastmail-quoted pre{margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:10pt;font-family:"Courier New";color:black;}
#fastmail-quoted #fastmail-quoted-fastmail-quoted p.fastmail-quoted-fastmail-quoted-MsoNoSpacing,#fastmail-quoted  #fastmail-quoted-fastmail-quoted li.fastmail-quoted-fastmail-quoted-MsoNoSpacing,#fastmail-quoted  #fastmail-quoted-fastmail-quoted div.fastmail-quoted-fastmail-quoted-MsoNoSpacing{margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:"Times New Roman", serif;color:black;}
#fastmail-quoted #fastmail-quoted-fastmail-quoted span.fastmail-quoted-fastmail-quoted-HTMLPreformattedChar{font-family:Consolas;color:black;}
#fastmail-quoted #fastmail-quoted-fastmail-quoted span.fastmail-quoted-fastmail-quoted-EmailStyle22{font-family:Calibri, sans-serif;color:rgb(31, 73, 125);}
#fastmail-quoted #fastmail-quoted-fastmail-quoted .fastmail-quoted-fastmail-quoted-MsoChpDefault{font-size:10pt;}
#fastmail-quoted #fastmail-quoted-fastmail-quoted div.fastmail-quoted-fastmail-quoted-WordSection1{}
#fastmail-quoted #fastmail-quoted-fastmail-quoted ol{margin-bottom:0in;}
#fastmail-quoted #fastmail-quoted-fastmail-quoted ul{margin-bottom:0in;}
#fastmail-quoted p.fastmail-quoted-MsoNormal,#fastmail-quoted  p.fastmail-quoted-MsoNoSpacing{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}

p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>OK, based on what Marten's expander seems to do and what I think makes sense, I've decide to go with:<br></div><ul><li>Deduplicate invalid dates that map (via skip) to the same valid date <i>before</i> applying bySetPosition.<br></li><li>Ignore any dates that were produced by an earlier iteration <i>after</i> applying bySetPosition.<br></li></ul><div><br></div><div>There's another issue I've realised is also undefined in RFC7529: how you apply byWeekNo and byYearDay to an invalid date (which can happen because you don't apply the skip for an invalid day-of-month until after these are applied according to the spec). Since this is clearly nonsense, I would say that they simply never match an invalid date.<br></div><div><br></div><div>I've updated the JSCalendar recurrence rule algorithm in <a href="https://github.com/CalConnect/PUBLIC_DRAFTS/pull/16/files">this pull request</a>; I believe this matches the semantics of <a href="https://tools.ietf.org/html/rfc7529">RFC7529</a> as far as they are defined there. If anyone with knowledge or implementation experience of this could check and confirm/disagree, that would be much appreciated.<br></div><div><br></div><div>JSCalendar is now in a two-week last call at the IETF and this is the only remaining issue, so I'd like to merge soon.<br></div><div><br></div><div>Neil.</div></body></html>