Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild the RFC5545 string from the RSET arrays #37

Open
obrienj970 opened this issue Sep 16, 2017 · 3 comments
Open

Rebuild the RFC5545 string from the RSET arrays #37

obrienj970 opened this issue Sep 16, 2017 · 3 comments

Comments

@obrienj970
Copy link

Is there any code available to rebuild the RFC5545 string from the arrays produced from the RSet() method?

@rlanvin
Copy link
Owner

rlanvin commented Sep 16, 2017

At the moment no, because I don't know how to do it. Basically the RSet object is more flexible than what the RFC allows, so in some cases there is no way to build a RFC-compliant string out of it. More info here: #26 (comment)

I am open to suggestions!

@obrienj970
Copy link
Author

Sorry to hear that.

Fortunately my use of RFC5545 is quite simple. At most only oneI RRULE, EXDATE and RDATE in any rule.

But unfortunately my experience with PHP is very limited compared to other languages so my attempt may be quite crude.

How might I use the code in rrule->rfcString to do the RRULE part given that I have an RSET array?

The EXDATE and RDATE pieces should be relatively straight forward

Jim

@rlanvin
Copy link
Owner

rlanvin commented Sep 18, 2017

How might I use the code in rrule->rfcString to do the RRULE part given that I have an RSET array?

Well basically you would use $rset->getRRules() to get an array, use foreach to loop and call rfcString() on each ones. However problems will occur once you have multiple RRULE, because this will generate multiple DTSTART segments, which is not allowed by the RFC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants