Skip to main content

Modals & Navigation

Pro Feature

The Programmatic API requires Prisma Calendar Pro.

openCreateEventModal(options?)

Opens the create event modal (same as the "Create new event" command).

Options:

PropertyTypeDefaultDescription
calendarIdstring?Target calendar ID. Uses last opened calendar if omitted.
autoStartStopwatchbooleanfalseAuto-start the stopwatch when the modal opens.
openCreatedInNewTabbooleanfalseOpen the newly created note in a new tab and focus it after creation.

Example:

window.PrismaCalendar.openCreateEventModal({ autoStartStopwatch: true });

openEditActiveNoteModal(options?)

Opens the edit modal for the currently active note (same as "Edit current note as event"). Ensures the note has a ZettelID first.

Options:

PropertyTypeDescription
calendarIdstring?Target calendar ID. Uses last opened if omitted.

Returns: Promise<boolean>true if the modal opened, false otherwise (e.g., no file open, file outside calendar directory).

Example:

const opened = await window.PrismaCalendar.openEditActiveNoteModal();

createUntrackedEvent(input)

Creates a Prisma note with ZettelID and no date properties (same as "Create new untracked event").

Input:

PropertyTypeRequiredDescription
titlestringyesEvent name
calendarIdstringnoTarget calendar ID

Returns: Promise<string | null> — File path of the created note, or null if creation failed.

Example:

const path = await window.PrismaCalendar.createUntrackedEvent({ title: "Quick capture" });

addZettelIdToActiveNote(options?)

Adds ZettelID to the currently active note (same as "Add ZettelID to current note").

Options:

PropertyTypeDescription
calendarIdstring?Target calendar ID

Returns: Promise<boolean>true if ZettelID was added or already present, false otherwise.

Example:

const ok = await window.PrismaCalendar.addZettelIdToActiveNote();

Opens the calendar and navigates to a specific date and view type.

Input:

PropertyTypeRequiredDescription
datestringnoISO date or datetime to navigate to (e.g. 2026-02-24). Defaults to today.
viewstringnoView type: dayGridMonth, timeGridWeek, timeGridDay, or listWeek.
calendarIdstringnoTarget calendar ID

Returns: Promise<boolean>true if the calendar was opened and navigated, false otherwise.

Example:

// Open weekly view for a specific date
await window.PrismaCalendar.navigateToDate({
date: "2026-03-01",
view: "timeGridWeek"
});

// Open today in daily view
await window.PrismaCalendar.navigateToDate({ view: "timeGridDay" });

// Open monthly view (defaults to today)
await window.PrismaCalendar.navigateToDate({ view: "dayGridMonth" });