forked from GitHubMirrors/silverbullet-icalendar
Chore: Add debug logging and iterate to 0.3.22
All checks were successful
Build SilverBullet Plug / build (push) Successful in 24s
All checks were successful
Build SilverBullet Plug / build (push) Successful in 24s
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { clientStore, config, datastore, editor, index } from "@silverbulletmd/silverbullet/syscalls";
|
||||
import { convertIcsCalendar } from "https://esm.sh/ts-ics@2.4.0";
|
||||
|
||||
const VERSION = "0.3.21";
|
||||
const VERSION = "0.3.22";
|
||||
const CACHE_KEY = "icalendar:lastSync";
|
||||
|
||||
console.log(`[iCalendar] Plug script executing at top level (Version ${VERSION})`);
|
||||
@@ -77,14 +77,17 @@ async function fetchAndParseCalendar(source: any, hourShift = 0): Promise<any[]>
|
||||
const events: any[] = [];
|
||||
for (const icsEvent of calendar.events) {
|
||||
const obj = icsEvent.start;
|
||||
if (!obj) continue;
|
||||
if (!obj) {
|
||||
console.warn("[iCalendar] Event has no start object:", icsEvent.summary);
|
||||
continue;
|
||||
}
|
||||
|
||||
let wallTimeStr = "";
|
||||
if (obj.local && typeof obj.local.date === "string") wallTimeStr = obj.local.date;
|
||||
else if (typeof obj.date === "string") wallTimeStr = obj.date;
|
||||
|
||||
if (!wallTimeStr) {
|
||||
console.warn("[iCalendar] Skipping event with no start date string:", icsEvent.summary);
|
||||
console.warn("[iCalendar] Skipping event with no start date string:", icsEvent.summary, "Start object structure:", JSON.stringify(obj));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user