Bump version to 0.2.4 and add timezone diagnostics
All checks were successful
Build SilverBullet Plug / build (push) Successful in 21s

This commit is contained in:
2026-02-17 06:52:03 -08:00
parent e3fcf743f8
commit 86824991a6
2 changed files with 9 additions and 4 deletions

View File

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

View File

@@ -3,12 +3,13 @@ import { localDateString } from "@silverbulletmd/silverbullet/lib/dates";
import { convertIcsCalendar, type IcsCalendar, type IcsEvent, type IcsDateObjects } from "ts-ics";
console.log("[iCalendar] Plug loading...");
console.log(`[iCalendar] Environment Timezone Offset: ${new Date().getTimezoneOffset()} minutes`);
// ============================================================================
// Constants
// ============================================================================
const VERSION = "0.2.3";
const VERSION = "0.2.4";
const CACHE_KEY = "icalendar:lastSync";
const DEFAULT_CACHE_DURATION_SECONDS = 21600; // 6 hours
@@ -85,10 +86,14 @@ function convertDatesToStrings<T>(obj: T): DateToString<T> {
}
if (obj instanceof Date) {
return localDateString(obj) as DateToString<T>;
const localized = localDateString(obj);
// console.log(`[iCalendar] Localized Date: ${obj.toISOString()} -> ${localized}`);
return localized as DateToString<T>;
}
if (isIcsDateObjects(obj) && obj.date instanceof Date) {
return localDateString(obj.date) as DateToString<T>;
const localized = localDateString(obj.date);
// console.log(`[iCalendar] Localized IcsDate: ${obj.date.toISOString()} -> ${localized}`);
return localized as DateToString<T>;
}
if (typeof obj === 'string' && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(obj)) {