forked from GitHubMirrors/silverbullet-icalendar
chore(conductor): Add new track 'Fix RRULE UNTIL conversion'
This commit is contained in:
20
conductor/tracks/fix_rrule_until_conversion_20260219/spec.md
Normal file
20
conductor/tracks/fix_rrule_until_conversion_20260219/spec.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# 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 `formatRRuleValue` to handle various types of RRULE values:
|
||||
- **Date Objects:** Convert to `YYYYMMDDTHHMMSSZ`.
|
||||
- **Nested Date Objects:** (e.g., `{ date: Date }` from `ts-ics`) Extract and convert.
|
||||
- **Other Types:** Default to string conversion.
|
||||
- **Mapping Preservation:** Maintain the existing `RRULE_KEY_MAP` for key translation.
|
||||
|
||||
## Implementation Steps
|
||||
1. **Reproduce:** Add test `expandRecurrences - object rrule with until` in `icalendar_test.ts` using a Date object for `until`. Verify it fails with `Invalid UNTIL value`.
|
||||
2. **Fix:** Update `expandRecurrences` in `icalendar.ts` to use a formatting helper for values.
|
||||
3. **Verify:** Confirm the test case passes.
|
||||
|
||||
## Acceptance Criteria
|
||||
- [ ] Test `expandRecurrences - object rrule with until` passes.
|
||||
- [ ] The generated string correctly represents the date (e.g., `UNTIL=20260219T000000Z`).
|
||||
Reference in New Issue
Block a user