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

added a method to force the provided start date to the first occurence #19

Closed
wants to merge 2 commits into from

Conversation

pospi
Copy link
Contributor

@pospi pospi commented Dec 12, 2013

I figured this was best implemented as a separate method so that it can be explicitly called if desirable and devs can continue to use their own exception handling otherwise.

also refactored date component extraction logic for reuse

@BarryDam
Copy link
Contributor

Perfect! Just what I needed.

p.s. if you return the When object (return $this) in your adjustStartDate method you can do something like this:

$r->rrule("FREQ=WEEKLY;DTSTART=20150902T000000;UNTIL=20151018T235959;INTERVAL=1;BYDAY=MO")
   ->adjustStartDate()
  ->generateOccurrences();

@bobemoe
Copy link

bobemoe commented Sep 14, 2019

This looks really useful... how come no merge?

Is there another way to find the next occurrence after Now?

I've tried $r->RFC5545_COMPLIANT = When::IGNORE; but still get the The start date must be the first occurrence. exception.

@tplaner
Copy link
Owner

tplaner commented Aug 29, 2021

This should not be needed since we have the ability to ignore the exception now.

@bobemoe the correct usage is:

$when = new When();
$when->RFC5545_COMPLIANT = When::IGNORE;

Definitely works, I use it frequently.

Feel free to open an issue with more detailed code showing a bug. Thanks!

@tplaner tplaner closed this Aug 29, 2021
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

Successfully merging this pull request may close these issues.

4 participants