Enough-Software / enough_icalendar

iCalendar library to parse, generate and respond to iCal / ics invites. Fully compliant with RFC 5545 (iCalendar) and RFC 5546 (iTIP).
Mozilla Public License 2.0
10 stars 9 forks source link

RRULE always appends `;WKST1` which breaks macOS Calendar recurrence #10

Closed tgrushka closed 1 year ago

tgrushka commented 1 year ago

Great package, the only one on pub.dev I've found so far that allows me to parse a text recurrence rule into the model.

Unfortunately, the output RRULE value always ends in ;WKST1 or the int value of weekday that is passed to startOfWorkWeek constructor.

If supplied at all, the output format should be WKST= + the two-letter day of week, like so: ;WKST=SU

This additionally results in the side-effect that Recurrence.parse(rrule) does not parse the generated WKST value correctly, as parse expects the two-letter day of week.

There is no output workaround except:

final vCalendar = VCalendar.createEvent(...);
vCalendar.event?.recurrenceRule = Recurrence.parse(rrule!);
final iCal = vCal.toString().replaceAll(';WKST1', ';WKST=SU');

This workaround must be done in order to get macOS Calendar (and possibly iOS Calendar, I haven't tested), to recognize a recurring event, because it does not tolerate the malformed WKST parameter.

There is no parsing workaround except replacing WKST1 with WKST=SU (or other day of week) before calling parse.

robert-virkus commented 1 year ago

Time surely flies by when you're having fun! Thanks so much for the detailed report - both problems are fixed in v0.15.0!