Bump version to 0.2.5 and add detailed date conversion logging
All checks were successful
Build SilverBullet Plug / build (push) Successful in 14s

This commit is contained in:
2026-02-17 07:15:37 -08:00
parent e79349d7c0
commit 45ab0e8d95
2 changed files with 8 additions and 10 deletions

View File

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

View File

@@ -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<T>(obj: T): DateToString<T> {
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<T>;
}
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<T>;
}