forked from GitHubMirrors/silverbullet-icalendar
2.3 KiB
2.3 KiB
Specification: Proper Timezone Handling & Recurring Events
Overview
Upgrade the SilverBullet iCalendar plug to provide accurate, DST-aware timezone resolution and full support for recurring events (RRULE expansion). This replaces manual hour shifting with an automated, reliable system using IANA timezone standards and the Intl API.
Functional Requirements
- IANA Timezone Mapping: Implement a comprehensive mapping of 139 Windows timezone names to IANA identifiers using Unicode CLDR data.
- DST-Aware Offsets: Calculate UTC offsets at runtime for specific event dates using the built-in
Intl.DateTimeFormatAPI, ensuring accuracy during Daylight Saving Time transitions. - Robust Date Extraction: Correct the wall-clock extraction logic to prevent "double-shifting" of event times.
- Recurring Event Expansion:
- Integrate the
rrulelibrary to expand recurring events into individual occurrences. - Support
EXDATEfor excluding specific instances of a recurring series. - Implement a configurable
syncWindowDays(default: 365) to limit the expansion range.
- Integrate the
- Advanced Filtering:
- Filter out "CANCELLED" events based on the iCalendar status field.
- (Optional) Add
includeTransparentandincludeDeclinedper-source flags.
- Error Handling & Fallbacks:
- If a timezone is unrecognized, fallback to UTC and append a warning to the event's description.
- Configuration Cleanup:
- Remove the redundant
tzShift/hourShiftparameters. - Add
syncWindowDaysglobal config.
- Remove the redundant
Non-Functional Requirements
- Self-Contained: Maintain the plug as a Deno-compatible project using
esm.shordeno.jsonimports. - Performance: Ensure efficient expansion of recurrences, even for busy calendars.
Acceptance Criteria
- Events from various providers (Google, O365, Nextcloud) appear at the correct local time in SilverBullet, regardless of DST.
- All occurrences of a weekly recurring event within the sync window are indexed.
- Excluded dates (
EXDATE) are correctly omitted from the index. - Cancelled events are not indexed.
- The manual
tzShiftconfiguration is no longer required for correct time display.
Out of Scope
- Full CalDAV synchronization (this remains a read-only
.icsfetcher). - UI for managing individual recurring instances (handled via SilverBullet queries).