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

Use DTSTART when BY* is missing #434

Closed
radarfox opened this issue Apr 15, 2020 · 4 comments
Closed

Use DTSTART when BY* is missing #434

radarfox opened this issue Apr 15, 2020 · 4 comments

Comments

@radarfox
Copy link

radarfox commented Apr 15, 2020

Hello,

I think I have found the bug in this library, that has not been covered by any other issue here.

From the RFC 5545 3.3.10:

Information, not contained in the rule, necessary to determine the
various recurrence instance start time and dates are derived from
the Start Time ("DTSTART") component attribute. For example,
"FREQ=YEARLY;BYMONTH=1" doesn't specify a specific day within the
month or a time. This information would be the same as what is
specified for "DTSTART".

... Then, lacking
information from "RRULE", the second is derived from "DTSTART", to
end up in "every Sunday in January at 8:30:00 AM and 9:30:00 AM,
every other year". Similarly, if the BYMINUTE, BYHOUR, BYDAY,
BYMONTHDAY, or BYMONTH rule part were missing, the appropriate
minute, hour, day, or month would have been retrieved from the
"DTSTART" property.

This isn't happening, at least with BYMONTH and BYMONTHDAY, as I have tested. The full list of BY* rules that should use this is: BYMONTH, BYMONTHDAY, BYDAY, BYHOUR, BYMINUTE and BYSECOND.

For example the following calendar has the single event. In this event the YEARLY frequency is defined and the day is second Friday, but the month is not explicitly mentioned. In this case, according to the RFC, the DTSTART should be used and the occurrences should be in August.

BEGIN:VCALENDAR
VERSION:2.0
PRODID:+//IDN ki-wi.cz//NONSGML Player Lighter//EN
BEGIN:VEVENT
UID:91890
DTSTAMP:20191210T230600Z
DTSTART:20200814T000000
DTEND:20200814T120000
RRULE:FREQ=YEARLY;BYDAY=2FR
SUMMARY:event recurring yearly each 2nd Friday of August forever
END:VEVENT
END:VCALENDAR

I would expect the occurrences to be in August:

20200814T000000
20210813T000000
20220812T000000

But this isn't happening, the occurrences are in January:

20210108T000000
20220114T000000
20230113T000000

From these values I think it's clear, that ICAL.Recur is using January, when the BYMONTH is not explicitly defined. By this rule the first occurrence makes sense, the 20210108 is the 2nd Friday of January after 20200814.

If the BYMONTH is defined, then occurrences are as expected:

RRULE:FREQ=YEARLY;BYDAY=2FR;BYMONTH=8
@dilyanpalauzov
Copy link
Contributor

dilyanpalauzov commented Dec 24, 2021

RRULE:FREQ=YEARLY;BYDAY=2FR means the second Friday in the year, see https://www.rfc-editor.org/errata/eid3779. Derivered from DTSTART are the hour and minutes, when the event starts, not the month.

@radarfox
Copy link
Author

radarfox commented Jan 3, 2022

It should be derivered for BYMONTH. But you may be right, it shouldn't be derivered for BYDAY. Please, give me some time to investigate and provide a more detailed report.

@kewisch kewisch added the needinfo More information has been requested label May 1, 2024
@kewisch
Copy link
Owner

kewisch commented May 1, 2024

Just checking in on this, @radarfox have you had a chance to take a closer look if any additional action is needed here? Would also appreciate a retest on the latest version.

Copy link

github-actions bot commented Jun 1, 2024

It looks like we haven't heard back on this issue, therefore we are closing this issue. If this problem persists in the latest version of ical.js, please re-open this issue.

@github-actions github-actions bot closed this as completed Jun 1, 2024
@github-actions github-actions bot removed the needinfo More information has been requested label Jun 1, 2024
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

3 participants