forked from GitHubMirrors/silverbullet-icalendar
1.2 KiB
1.2 KiB
Specification: Fix RRULE UNTIL Object Conversion
Overview
The conversion of RRULE objects to strings fails for nested objects like UNTIL dates, resulting in UNTIL=[object Object]. This causes the rrule library to fail during expansion.
Functional Requirements
- Robust Value Formatting: Implement
formatRRuleValueto handle various types of RRULE values:- Date Objects: Convert to
YYYYMMDDTHHMMSSZ. - Nested Date Objects: (e.g.,
{ date: Date }fromts-ics) Extract and convert. - Other Types: Default to string conversion.
- Date Objects: Convert to
- Mapping Preservation: Maintain the existing
RRULE_KEY_MAPfor key translation.
Implementation Steps
- Reproduce: Add test
expandRecurrences - object rrule with untilinicalendar_test.tsusing a Date object foruntil. Verify it fails withInvalid UNTIL value. - Fix: Update
expandRecurrencesinicalendar.tsto use a formatting helper for values. - Verify: Confirm the test case passes.
Acceptance Criteria
- Test
expandRecurrences - object rrule with untilpasses. - The generated string correctly represents the date (e.g.,
UNTIL=20260219T000000Z).