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

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

Open
fabioi opened this issue Apr 7, 2021 · 0 comments

Comments

@fabioi
Copy link

fabioi commented Apr 7, 2021

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?

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

No branches or pull requests

1 participant