recurr icon indicating copy to clipboard operation
recurr copied to clipboard

Question: best way to create recurrent events such as: recurring indefinitely form 15 July to 15 October on Tuesday and Wednesday at 10:30

Open fabioi opened this issue 3 years ago • 0 comments

Hi all, first and foremost thank you for this fantastic package!

I am quite new to recurrent events implementation. I was wondering which could be the best way to create recurrent events such as an event recurring indefinitely yearly from 15 July to 15 October on Tuesday and Wednesday at 10:30.

I see I can set the months, but not sure how to exclude a part of a month (eg: each year exclude 1-14 of July).

For example using the library, for a similar event I come up to: FREQ=YEARLY;UNTIL=20991212T235959;DTSTART=20210406T202848;BYMINUTE=30;BYHOUR=10;BYDAY=MO,TU;BYMONTH=01

 $rule = (new Rule())
              ->setStartDate((new DateTime()), TRUE)
              ->setTimezone(config('app.timezone'))
              ->setFreq('YEARLY') 
              ->setByHour([$hour]) 
              ->setByMinute([$minutes])
              ->setByMonth($months) 
              ->setByDay($weekDays)
              ->setUntil($untilDate));

do you have any hint on what could be the best practice for this case?

fabioi avatar Apr 07 '21 08:04 fabioi