diff --git a/PLUG.md b/PLUG.md index ac5dc68..43be2a6 100644 --- a/PLUG.md +++ b/PLUG.md @@ -1,6 +1,6 @@ --- name: Library/sstent/icalendar/PLUG -version: 0.2.4 +version: 0.2.5 tags: meta/library files: - icalendar.plug.js diff --git a/icalendar.ts b/icalendar.ts index c92ff76..c3a9f04 100644 --- a/icalendar.ts +++ b/icalendar.ts @@ -2,16 +2,14 @@ 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"; -console.log("[iCalendar] Plug loading..."); +const VERSION = "0.2.5"; +const CACHE_KEY = "icalendar:lastSync"; +const DEFAULT_CACHE_DURATION_SECONDS = 21600; // 6 hours + +console.log(`[iCalendar] Plug loading (Version ${VERSION})...`); console.log(`[iCalendar] Environment Timezone Offset: ${new Date().getTimezoneOffset()} minutes`); // ============================================================================ -// Constants -// ============================================================================ - -const VERSION = "0.2.4"; -const CACHE_KEY = "icalendar:lastSync"; -const DEFAULT_CACHE_DURATION_SECONDS = 21600; // 6 hours // ============================================================================ // Types @@ -87,12 +85,12 @@ function convertDatesToStrings(obj: T): DateToString { if (obj instanceof Date) { const localized = localDateString(obj); - // console.log(`[iCalendar] Localized Date: ${obj.toISOString()} -> ${localized}`); + console.log(`[iCalendar] Localizing Date Object: UTC=${obj.toISOString()} -> Local=${localized}`); return localized as DateToString; } if (isIcsDateObjects(obj) && obj.date instanceof Date) { const localized = localDateString(obj.date); - // console.log(`[iCalendar] Localized IcsDate: ${obj.date.toISOString()} -> ${localized}`); + console.log(`[iCalendar] Localizing ICS Date: UTC=${obj.date.toISOString()} -> Local=${localized} (TZID: ${obj.timezone || "none"})`); return localized as DateToString; }