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

Support BYYEARDAY with BYDAY #730

Open
githubberspeaks opened this issue Jul 10, 2024 · 2 comments
Open

Support BYYEARDAY with BYDAY #730

githubberspeaks opened this issue Jul 10, 2024 · 2 comments

Comments

@githubberspeaks
Copy link

Hi, the ical.js library is being used in an ICS Sync script, and I reported this bug there but was advised to report it here.

Any suggestions on how to fix this or debug which event is causing this error (Exception thrown at line 7043 in ical.js.gs)?

This error didn't occur earlier, but I started noticing this in the past week.

347021602-42cb4aab-1342-41e2-9ade-436f6c2adae3 Screenshot 2024-07-09 at 3 54 41 PM
@jonas0b1011001
Copy link

Additional info:

The error occurs parsing a VTIMEZONE object created by Apple Calendar, the full VTIMEZONE is attached for reference.

After scanning RFC 5545 i think the combination of BYYEARDAY and BYDAY is valid ical syntax.

If multiple BYxxx rule parts are specified, then after evaluating
the specified FREQ and INTERVAL rule parts, the BYxxx rule parts
are applied to the current set of evaluated occurrences in the
following order: BYMONTH, BYWEEKNO, BYYEARDAY, BYMONTHDAY, BYDAY,
BYHOUR, BYMINUTE, BYSECOND and BYSETPOS; then COUNT and UNTIL are
evaluated.

BEGIN:VTIMEZONE
TZID:Europe/Istanbul
X-LIC-LOCATION:Europe/Istanbul
BEGIN:STANDARD
DTSTART:18800101T000000
RDATE:18800101T000000
TZNAME:IMT
TZOFFSETFROM:+015552
TZOFFSETTO:+015656
END:STANDARD
BEGIN:STANDARD
DTSTART:19101001T000000
RDATE:19101001T000000
TZNAME:EEST
TZOFFSETFROM:+015656
TZOFFSETTO:+0200
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19160501T000000
RDATE:19160501T000000
RDATE:19200328T000000
RDATE:19210403T000000
RDATE:19220326T000000
RDATE:19240513T000000
RDATE:19250501T000000
RDATE:19400630T000000
RDATE:19401201T000000
RDATE:19420401T000000
RDATE:19450402T000000
RDATE:19460601T000000
RDATE:19490410T000000
RDATE:19500419T000000
RDATE:19510422T000000
RDATE:19620715T000000
RDATE:19640515T000000
RDATE:19730603T010000
RDATE:19740331T020000
RDATE:19750330T000000
RDATE:19760601T000000
RDATE:19940320T010000
RDATE:20160327T030000
TZNAME:EEST
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:19161001T000000
RDATE:19161001T000000
RDATE:19201025T000000
RDATE:19211003T000000
RDATE:19221008T000000
RDATE:19401005T000000
RDATE:19410921T000000
RDATE:19421101T000000
RDATE:19451008T000000
RDATE:19461001T000000
RDATE:19511008T000000
RDATE:19621008T000000
RDATE:19641001T000000
RDATE:19731104T030000
RDATE:19741103T050000
RDATE:19771016T000000
RDATE:19850928T000000
RDATE:20141026T040000
RDATE:20151108T040000
TZNAME:EET
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
END:STANDARD
BEGIN:STANDARD
DTSTART:19241001T000000
RRULE:FREQ=YEARLY;UNTIL=19250930T210000Z;BYMONTH=10
TZNAME:EET
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19470420T000000
RRULE:FREQ=YEARLY;UNTIL=19480417T220000Z;BYMONTH=4;BYMONTHDAY=16,17,18,19
 ,20,21,22;BYDAY=SU
TZNAME:EEST
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:19471005T000000
RRULE:FREQ=YEARLY;UNTIL=19501007T210000Z;BYMONTH=10;BYMONTHDAY=2,3,4,5,6,
 7,8;BYDAY=SU
TZNAME:EET
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19700503T000000
RRULE:FREQ=YEARLY;UNTIL=19720506T220000Z;BYMONTH=5;BYMONTHDAY=2,3,4,5,6,7
 ,8;BYDAY=SU
TZNAME:EEST
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:19701004T000000
RRULE:FREQ=YEARLY;UNTIL=19721007T210000Z;BYMONTH=10;BYMONTHDAY=2,3,4,5,6,
 7,8;BYDAY=SU
TZNAME:EET
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
END:STANDARD
BEGIN:STANDARD
DTSTART:19751026T000000
RRULE:FREQ=YEARLY;UNTIL=19761030T210000Z;BYMONTH=10;BYDAY=-1SU
TZNAME:EET
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19770403T000000
RRULE:FREQ=YEARLY;UNTIL=19780401T220000Z;BYMONTH=4;BYDAY=1SU
TZNAME:EEST
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
END:DAYLIGHT
BEGIN:DAYLIGHT
DTSTART:19781015T000000
RDATE:19781015T000000
RDATE:19800406T030000
RDATE:19830731T000000
TZNAME:+04
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:DAYLIGHT
DTSTART:19790401T030000
RDATE:19790401T030000
TZNAME:+04
TZOFFSETFROM:+0400
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:19791015T000000
RRULE:FREQ=YEARLY;UNTIL=19821010T200000Z;BYMONTH=10;BYDAY=-3MO
TZNAME:+03
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19810329T030000
RRULE:FREQ=YEARLY;UNTIL=19820328T000000Z;BYMONTH=3;BYDAY=-1SU
TZNAME:+04
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:19831002T000000
RDATE:19831002T000000
TZNAME:+03
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:STANDARD
DTSTART:19850420T000000
RDATE:19850420T000000
TZNAME:EEST
TZOFFSETFROM:+0300
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19860330T010000
RRULE:FREQ=YEARLY;UNTIL=19930327T230000Z;BYMONTH=3;BYDAY=-1SU
TZNAME:EEST
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:19860928T020000
RRULE:FREQ=YEARLY;UNTIL=19950923T230000Z;BYMONTH=9;BYDAY=-1SU
TZNAME:EET
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19950326T010000
RRULE:FREQ=YEARLY;UNTIL=20060325T230000Z;BYMONTH=3;BYDAY=-1SU
TZNAME:EEST
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:19961027T020000
RRULE:FREQ=YEARLY;UNTIL=20061028T230000Z;BYMONTH=10;BYDAY=-1SU
TZNAME:EET
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
END:STANDARD
BEGIN:STANDARD
DTSTART:20070101T000000
RDATE:20070101T000000
RDATE:20110327T030000
RDATE:20140330T030000
TZNAME:EET
TZOFFSETFROM:+0200
TZOFFSETTO:+0200
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20070325T030000
RRULE:FREQ=YEARLY;UNTIL=20100328T010000Z;BYMONTH=3;BYDAY=-1SU
TZNAME:EEST
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20071028T040000
RRULE:FREQ=YEARLY;UNTIL=20101031T010000Z;BYMONTH=10;BYDAY=-1SU
TZNAME:EET
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20110328T030000
RRULE:FREQ=YEARLY;UNTIL=20130331T010000Z;BYYEARDAY=-275,-276,-277,-278,-2
 79,-280,-281;BYDAY=MO
TZNAME:EEST
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20111030T040000
RRULE:FREQ=YEARLY;UNTIL=20131027T010000Z;BYMONTH=10;BYDAY=-1SU
TZNAME:EET
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20140331T030000
RRULE:FREQ=YEARLY;UNTIL=20150329T010000Z;BYYEARDAY=-275,-276,-277,-278,-2
 79,-280,-281;BYDAY=MO
TZNAME:EEST
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
END:DAYLIGHT
BEGIN:DAYLIGHT
DTSTART:20151025T040000
RDATE:20151025T040000
TZNAME:EEST
TZOFFSETFROM:+0300
TZOFFSETTO:+0300
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20160907T000000
RDATE:20160907T000000
TZNAME:+03
TZOFFSETFROM:+0300
TZOFFSETTO:+0300
END:STANDARD
END:VTIMEZONE

@kewisch
Copy link
Owner

kewisch commented Jul 21, 2024

I don't see anything to indicate BYYEARDAY and BYDAY are invalid either. This probably comes from the older version of libical where this was forked from, and at the time it was not implemented. What you could do is see how/if libical has implemented this, and the port the approach over to ical.js. Is this something you'd be up for?

@kewisch kewisch changed the title Error: Invalid BYYEARDAY rule Support BYYEARDAY with BYDAY Jul 21, 2024
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

3 participants