-
Notifications
You must be signed in to change notification settings - Fork 84
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
Access humanReadable from RSET? #115
Comments
Hello, I'm afraid at the moment you can't. I might try to build it at some point, but I can't guarantee I'll have time anytime soon. If you want to look into this, feel free to submit a PR for review. In the meantime, if you want a workaround, you could do a quick & dirty manual version for your particular use case, something like: $rset = new RSet();
$rset->addRRule(array(
'FREQ' => 'weekly',
'INTERVAL' => 1,
'BYDAY' => 'MO, TU, WE, TH, FR',
'DTSTART' => '2022-09-20 11:00:00',
'UNTIL' => '2022-10-01 12:00:00'
));
$rset->addExdate('2022-09-22 11:00:00');
$formatter = \IntlDateFormatter::create(
'en-GB',
\IntlDateFormatter::SHORT,
\IntlDateFormatter::NONE
);
echo $rset->getRRules()[0]->humanReadable(array('locale' => 'en-GB'));
echo " except ";
echo $formatter->format($rset->getExDates()[0]);
// weekly on Monday, Tuesday, Wednesday, Thursday and Friday, starting from 20/09/2022, until 01/10/2022 except 22/09/2022 |
Thanks so much! |
Yes you are correct - EXDATE and RRULE and two different properties of the iCalendar format (RFC5545). EXDATE is not part of RRULE. |
HI,
I couldn't figure out how to use EXDATE with new RRule(), so I've used new RSet() instead.
This is all working, but how can I access the humanReadable() function for RSet?
My code is below. Thanks for your help and thanks for a great library!
The text was updated successfully, but these errors were encountered: