Any way to ignore weekend days?


In addition to a prior post about weekdays only, I would like to create a pattern like “Every 3rd weekday of January 2004”. I want weekend days completely ignored, not just excluded from the occurrence dates. For example, I would consider Wed. to be 3 weekdays after Friday, but if you just count every third day that’s not a weekend, Monday is. The dates I would like to see are 1/1/2004, 1/6/2004, 1/9/2004, 1/14/2004, 1/19/2004, 1/22/2004, 1/27/2004 and 1/30/2004. However, using:


I get 1/1/2004, 1/7/2004, 1/13/2004, 1/16/2004, 1/19/2004, 1/22/2004 and 1/28/2004. Is there any way to represent the pattern I want? I’m really not even sure it’s possible with the full iCalendar specification, but I would appreciate any help on this.


Good pattern.

The issue here is that according to the iCalendar standard INTERVAL rule part is processed before any BYXXX rule parts are processed.

This results in “take every 3rd day, then take only MO,TU,WE,TH,FR from the result set”.

Obviously this is not “take MO, TU, WE, TH, FR and then take every third from the result” that will achieve the desired result.

So far we have not found a way to do what you want in iCalendar, but we will try a few more ideas. Hard to belive that iCalendar does not support such seemingly simple pattern.

We tried using BYSETPOS=3,6,9…, but BYSETPOS (according to the standard) works within each interval so it will not work for your DAILY well.


It’s not a pressing issue, as our customer wants “Outlook-style recurrence” which doesn’t include any weekday patterns other than “Every weekday”, which of course, works just fine. Also, “every other weekday” will work using the pattern above with INTERVAL of 2 on the fact that a weekend contains two days. The pattern still considers weekend days, but the result is the same. This seems like a useful enough pattern, though, so I’d still like to know if there is a way to represent it. Thanks.


We’ve found the pattern that will work for this, but you need to use latest Aspose.iCalendar 1.0.2 for this to work.


I must admit the pattern is quite complex and not sure if it will be helpful to you.