You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a use case where i want to remove all the dates that are present inside an RSet giving a period of time.
For example a new DatePeriod() object giving a start and end. i want to then remove all the dates from the Rset.
At first we thought we could use addExDate but this doesnt work, because apperantly u have to have the exact date and not just the date to remove..
To clarfiy, i dont have the exact timestamp of the Dates inside Rset , but i do want to remove all the dates that are inside the DatePeriod.
Can i manually iterate Rset and remove the dates.. wasnt sure it is the expected behavior/...
Any help would be appreciated and many thanks again for your hard work
The text was updated successfully, but these errors were encountered:
Hello, that's a good question. Indeed ExDate must match single occurrences, so it's not necessarily practical for the use case you describe. There is no such thing if the RFC to exclude a period like you describe, so it's not a feature that I implemented. For now I could think of possible workarounds:
You could use a ExRule with the exact same rule, only with a different DTSTART and with a UNTIL date. That rule will generate the occurrences to be excluded. Technically a ExRule could even be another RSet if you have complex rule.
Split your rules or RSet: make one with a UNTIL corresponding to the start of your blacklisted period, and another one starting at the end of your blacklisted period, so no occurrences would be generated during the exclusion period (you can put those two split rules inside a RSet and it would be transparent)
You could wrap the RSet in a proxy class that would filter out the occurrences you don't need based on simple date comparison before returning them.
I suppose it would also be possible to extend the library to support an exclusion period directly as part of RSet. If you want to work on a pull request go for it.
Thank you so much for this amazing Library.
We have a use case where i want to remove all the dates that are present inside an RSet giving a period of time.
For example a new DatePeriod() object giving a start and end. i want to then remove all the dates from the Rset.
At first we thought we could use addExDate but this doesnt work, because apperantly u have to have the exact date and not just the date to remove..
To clarfiy, i dont have the exact timestamp of the Dates inside Rset , but i do want to remove all the dates that are inside the DatePeriod.
Can i manually iterate Rset and remove the dates.. wasnt sure it is the expected behavior/...
Any help would be appreciated and many thanks again for your hard work
The text was updated successfully, but these errors were encountered: