forked from GitHubMirrors/silverbullet-icalendar
1.6 KiB
1.6 KiB
Specification: Fix RRULE Object Expansion Error
Overview
The previous fix for handling object-type rrule properties (returned by ts-ics) introduced a regression. The conversion logic used uppercase full names (e.g., FREQUENCY), but the rrule library's parseString method expects standard iCalendar shortened keys (e.g., FREQ). This results in an Error: Unknown RRULE property 'FREQUENCY'.
Functional Requirements
- Correct Key Mapping: The logic that converts an
rruleobject back to a string must use standard iCalendar RRULE property keys. - Mapping Table:
frequency->FREQuntil->UNTILcount->COUNTinterval->INTERVALbysecond->BYSECONDbyminute->BYMINUTEbyhour->BYHOURbyday->BYDAYbymonthday->BYMONTHDAYbyyearday->BYYEARDAYbyweekno->BYWEEKNObymonth->BYMONTHbysetpos->BYSETPOSwkst->WKST
- Case Insensitivity: The mapping should be case-insensitive for the input object keys.
Implementation Steps
- Reproduce: Update the existing
expandRecurrences - object rruletest case to use the keyfrequencyand verify it fails with the reported error. - Fix: Implement a mapping function in
icalendar.tsto translate object keys to standard RRULE keys before stringifying. - Verify: Run the test case to confirm it now passes.
Acceptance Criteria
- Test
expandRecurrences - object rrulepasses with an object usingfrequencykey. - No "Unknown RRULE property" errors are logged for valid RRULE objects.