Skip to main content

Status & Lifecycle

Pro Feature

The Programmatic API requires Prisma Calendar Pro.

markAsDone(input)

Marks an event as done using the configured status property.

Input:

PropertyTypeRequiredDescription
filePathstringyesPath to the event file
calendarIdstringnoTarget calendar ID

Returns: Promise<boolean>

Example:

await window.PrismaCalendar.markAsDone({
filePath: "Calendar/260224090000 Workout.md"
});

markAsUndone(input)

Marks an event as not done using the configured status property.

Input:

PropertyTypeRequiredDescription
filePathstringyesPath to the event file
calendarIdstringnoTarget calendar ID

Returns: Promise<boolean>

Example:

await window.PrismaCalendar.markAsUndone({
filePath: "Calendar/260224090000 Workout.md"
});

toggleSkip(input)

Toggles the skip status of an event.

Input:

PropertyTypeRequiredDescription
filePathstringyesPath to the event file
calendarIdstringnoTarget calendar ID

Returns: Promise<boolean>

Example:

await window.PrismaCalendar.toggleSkip({
filePath: "Calendar/260224090000 Weekly Review.md"
});

cloneEvent(input)

Creates a copy of an event, optionally shifted by a time offset. The clone gets a new ZettelID.

Input:

PropertyTypeRequiredDescription
filePathstringyesPath to the event file to clone
offsetMsnumbernoTime offset in milliseconds (default: 0)
calendarIdstringnoTarget calendar ID

Returns: Promise<string | null> — File path of the cloned event, or null on failure.

Example:

// Clone an event to the same time
const clonedPath = await window.PrismaCalendar.cloneEvent({
filePath: "Calendar/260224090000 Team Meeting.md"
});

// Clone an event shifted forward by 1 week
const nextWeek = await window.PrismaCalendar.cloneEvent({
filePath: "Calendar/260224090000 Team Meeting.md",
offsetMs: 7 * 24 * 60 * 60 * 1000
});

moveEvent(input)

Moves an event forward or backward in time by a millisecond offset.

Input:

PropertyTypeRequiredDescription
filePathstringyesPath to the event file to move
offsetMsnumberyesTime offset in milliseconds (positive = forward, negative = backward)
calendarIdstringnoTarget calendar ID

Returns: Promise<boolean>

Example:

// Move an event forward by 1 hour
await window.PrismaCalendar.moveEvent({
filePath: "Calendar/260224090000 Team Meeting.md",
offsetMs: 60 * 60 * 1000
});

// Move an event back by 30 minutes
await window.PrismaCalendar.moveEvent({
filePath: "Calendar/260224090000 Team Meeting.md",
offsetMs: -30 * 60 * 1000
});