Migrate to ts-ics 2.4.0 API and fix duplicate recurring events

ts-ics 2.4.0 changed API from parseIcsCalendar to convertIcsCalendar
and VCalendar to IcsCalendar. The new API returns Date objects and
nested date structures that require recursive conversion to strings
for SilverBullet indexing.

Recurring events were creating duplicate refs because the hash only
used the UID, which is identical across occurrences. Including the
start date in the unique key ensures each occurrence gets a distinct
ref.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Alexandre Nicolaie <xunleii@users.noreply.github.com>
This commit is contained in:
Alexandre Nicolaie
2025-10-18 11:32:55 +02:00
parent 904c1b9d94
commit deb30ab6b3
2 changed files with 162 additions and 139 deletions

View File

@@ -20,6 +20,6 @@
},
"imports": {
"@silverbulletmd/silverbullet": "jsr:@silverbulletmd/silverbullet@^2.0.0",
"ts-ics": "npm:ts-ics@1.6.5"
"ts-ics": "npm:ts-ics@2.4.0"
}
}