icalparser icon indicating copy to clipboard operation
icalparser copied to clipboard

Yearly recurring events in January are not handled correctly

Open lokonli opened this issue 4 years ago • 2 comments

I think I found a bug: Yearly recurring events in January are not handled correctly, except for the first occurrence.

It's difficult to debug the code, but I think it's caused by the following line:

https://github.com/OzzyCzech/icalparser/blob/255d3d208bf6adcbb145920d8cde75fdbbf25ede/src/Freq.php#L256

						if ($imm > $offset && $imm <= $eop && ($_t == null || $imm < $_t)) {

If this is changed into:

						if ($imm >= $offset && $imm <= $eop && ($_t == null || $imm < $_t)) {

then it's working.

Shall I make a PR for this?

lokonli avatar Jan 13 '22 22:01 lokonli

Similar bug is reported here btw: https://github.com/fangel/SG-iCalendar/issues/15

lokonli avatar Jan 13 '22 22:01 lokonli

Is there any update on this issue? Facing the same issue with the latest version (v3.0.2) Tried changing the below condition, Issue did not fix

if ($imm >= $offset && $imm <= $eop && ($_t == null || $imm < $_t)) {

BEGIN:VCALENDAR
VERSION:2.0
PRODID:c90ca397-8326-4b37-acf8-7c1c18c42766
X-WR-TIMEZONE:Asia/Kolkata
X-PUBLISHED-TTL:P1W
BEGIN:VTIMEZONE
TZID:Asia/Kolkata
X-LIC-LOCATION:Asia/Kolkata
END:VTIMEZONE
BEGIN:VEVENT
UID:078c1612-01c5-4021-9b11-cca336b64f04
DTSTART;VALUE=DATE:20230101
SEQUENCE:0
TRANSP:OPAQUE
DTEND;VALUE=DATE:20230102
SUMMARY:Jan Year
CLASS:PUBLIC
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=1;BYMONTHDAY=1
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
DTSTAMP:20220905T084831Z
END:VEVENT
END:VCALENDAR

Thanks in advance

Meghabm07 avatar Sep 05 '22 09:09 Meghabm07