Bump version to 0.2.9 and improve ISO localization logic
All checks were successful
Build SilverBullet Plug / build (push) Successful in 28s

This commit is contained in:
2026-02-17 07:58:46 -08:00
parent 8087031220
commit ab0db17a47
2 changed files with 5 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
---
name: Library/sstent/icalendar/PLUG
version: 0.2.8
version: 0.2.9
tags: meta/library
files:
- icalendar.plug.js

View File

@@ -2,7 +2,7 @@ import { clientStore, config, datastore, editor, index } from "@silverbulletmd/s
import { localDateString } from "@silverbulletmd/silverbullet/lib/dates";
import { convertIcsCalendar, type IcsCalendar, type IcsEvent, type IcsDateObjects } from "ts-ics";
const VERSION = "0.2.8";
const VERSION = "0.2.9";
const CACHE_KEY = "icalendar:lastSync";
const DEFAULT_CACHE_DURATION_SECONDS = 21600; // 6 hours
@@ -95,8 +95,9 @@ function convertDatesToStrings<T>(obj: T, timezones?: any): DateToString<T> {
}
if (typeof obj === 'string' && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(obj)) {
console.log(`[iCalendar] Localizing ISO String: ${obj}`);
return localDateString(new Date(obj)) as DateToString<T>;
const localized = localDateString(new Date(obj + (obj.endsWith("Z") ? "" : "Z")));
console.log(`[iCalendar] Localizing ISO String: Raw=${obj} -> PST=${localized}`);
return localized as DateToString<T>;
}
if (Array.isArray(obj)) {