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

Wrong recurrence handling #212

Closed
arzzcom opened this issue Mar 17, 2019 · 5 comments
Closed

Wrong recurrence handling #212

arzzcom opened this issue Mar 17, 2019 · 5 comments

Comments

@arzzcom
Copy link

arzzcom commented Mar 17, 2019

  • PHP Version: 7.2.15
  • PHP date.timezone: Asia/Seoul
  • ICS Parser Version: 2.1.9
  • Linux

RRULE is FREQ=MONTHLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=1

It means every month's first day but not the weekend (SU, SA).
2019-05-01 is Wednesday so this rule refers to 2019-05-01.
2019-06-01 is Saturday so this rule refers to 2019-06-03.
However, this rule refers to every Monday of each month.

And

RRULE is FREQ=MONTHLY;INTERVAL=1;BYDAY=SU,MO,TU,WE,TH,FR,SA;BYSETPOS=-1

It means every month's last day like this 2019-04-30, 2019-05-31.
However, this rule refers to the last Saturday of each month.

@u01jmg3
Copy link
Owner

u01jmg3 commented Apr 2, 2019

  • In branch issue-212 I have attempted to fix the two rules you mention in this issue - let me know what you think.

  • Note this does not tackle more complicated rules such as the following as I am limited to relative date formats unless a large proportion of the parser is rewritten to use something other than strtotime().
    • FREQ=MONTHLY;BYDAY=WE,FR;BYSETPOS=3;COUNT=5
      • BYDAY=WE,FR;BYSETPOS=3

@u01jmg3
Copy link
Owner

u01jmg3 commented May 12, 2019

@arzzcom: are you able to test the code I have written to fix this issue?

@arzzcom
Copy link
Author

arzzcom commented May 13, 2019

@u01jmg3 Sorry! I'm late. I'll test now. :)

@arzzcom
Copy link
Author

arzzcom commented May 13, 2019

@u01jmg3 It works! Thanks.
But RRULE:FREQ=MONTHLY;INTERVAL=1 is not working without BYMONTHDAY it follows the origin event's date.

@u01jmg3
Copy link
Owner

u01jmg3 commented May 13, 2019

Thanks for testing, will look at RRULE:FREQ=MONTHLY;INTERVAL=1 in a new issue (#221)

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

No branches or pull requests

2 participants