iCal icon indicating copy to clipboard operation
iCal copied to clipboard

How to create recurring event in v2*

Open jokaorgua opened this issue 4 years ago • 6 comments

Hello everyone.

I can not understand how to create a recurring event with version 2.*

I see that there is RecurrenceRule class in https://github.com/markuspoerschke/iCal/blob/0.11.x/src/Eluceo/iCal/Property/Event/RecurrenceRule.php

But I do not see anything similar in v2.*

Could anyone guide me on how to create a recurring event for 'Every Monday at 9.00 during January' ?

Thanks in advance

jokaorgua avatar Jan 04 '22 10:01 jokaorgua

+1 to implement this missing functionality in v2

alies-dev avatar Mar 11 '22 11:03 alies-dev

Hi all,

We really need this feature for a project we are working on, and we used this feature in 0.16. Is there any news about this?

RickVdrongelen avatar Jan 10 '23 16:01 RickVdrongelen

It perfectly works on 0.16 :)

alies-dev avatar Jan 10 '23 17:01 alies-dev

I am the maintainer of the Drupal module "Views iCal" which uses this library to render iCalendar pages. This issue is a blocker for me to upgrade to 2.0.

https://www.drupal.org/project/views_ical/issues/3209012

Edit: I think we can go one of two routes, 1, simply treating recur rules as strings, and be agnostic of the meanings those rules have. Or two, we add a new "Domain\ValueObject" class for this, and in that depend on rlanvin/php-rrule for generating our recurrence rules instead of trying to set up our own system of parsing/generating these.

The 0.x version of the library took the latter approach, and you would build a class and feed it individual rrule properties e.g. https://github.com/markuspoerschke/iCal/blob/0.x/examples/example3.php#L20 , The only reason to get involved in the generation of these rrule strings, is to enforce proper formatting, but I can definitely appreciate this aspect, rather then letting people struggle to figure out what is wrong with their rrules.

I'm going to checkout the rlanvin/php-rrule library to see if this can be leveraged.

johnbburg avatar Mar 04 '24 17:03 johnbburg

In the meantime, it might be possible to generate RRULE fields in calendars using custom properties. See example 2 https://github.com/markuspoerschke/iCal/blob/2.x/examples/example2.php#L45

johnbburg avatar Mar 04 '24 21:03 johnbburg