Calendar & Events

Calendar is a native OcaltQL domain. Events, recurrence, reminders, availability, and import/export are all first-class verbs. There is no prefix namespace and no string-parsing of dates or intervals.

NEW EVENT

Creates a calendar event. All modifiers are optional except the title. SET captures the event object.

Basic event
NEW EVENT "Team Standup"
ON "2026-07-01" FROM "09:00" TO "09:30"
TIMEZONE "Africa/Johannesburg"
WITH DESCRIPTION "Daily team sync"
WITH ATTENDEES "alice@co.com" AND "bob@co.com"
AT LOCATION "Conference Room A"
REMIND 15 MINUTES BEFORE
SET ?ev
AFTER EMIT ?ev("id")
All day event
NEW EVENT "Company Holiday"
ON "2026-08-09" ALL DAY
SET ?ev

Recurring Events

EVERY sets the recurrence rule. STARTING and UNTIL bound the series. Without UNTIL, the event recurs indefinitely.

Keyword Recurrence
EVERY DAYDaily
EVERY WEEKDAYMonday through Friday
EVERY WEEKWeekly on the same day
EVERY MONDAYEVERY SUNDAYWeekly on a named day
EVERY MONTHMonthly on the same date
EVERY YEARAnnually on the same date
Recurring event
NEW EVENT "Weekly Review"
EVERY MONDAY FROM "10:00" TO "11:00"
STARTING "2026-07-07"
UNTIL "2026-12-31"
SET ?ev

Reminders & Triggers

REMIND N MINUTES BEFORE sets a reminder on the event. THEN chains an action to fire when the reminder triggers — any OcaltQL verb is valid after THEN.

Reminder with mail trigger
NEW EVENT "Weekly Report"
EVERY MONDAY FROM "09:00" TO "09:30"
STARTING "2026-07-07"
REMIND 10 MINUTES BEFORE
THEN MAIL TEXT BODY "Weekly report starting in 10 minutes." TO "admin@myco.com" SUBJECT "Report Reminder"
SET ?ev
AFTER EMIT ?ev("id")

Supported interval units: MINUTES, HOURS, DAYS.

Querying Events

Native temporal keywords replace string arguments. WHERE filters use structured clauses, not string expressions.

Temporal queries
GET EVENTS TODAY SET ?today
AFTER GET EVENTS THIS WEEK SET ?thisweek
AFTER GET EVENTS THIS MONTH SET ?thismonth
AFTER GET EVENTS FROM "2026-07-01" TO "2026-07-31" SET ?range
AFTER GET NEXT EVENT SET ?next
AFTER EMIT ?next
Filtered queries
GET EVENTS THIS WEEK WHERE TITLE CONTAINS "Standup" SET ?byTitle
AFTER GET EVENTS FROM "2026-07-01" TO "2026-07-31"
WHERE LOCATION IS "Conference Room A"
SET ?byLocation
AFTER EMIT ?byTitle
WHERE operator Description
TITLE IS "..."Exact title match
TITLE CONTAINS "..."Title substring match
LOCATION IS "..."Exact location match
LOCATION CONTAINS "..."Location substring match
ATTENDEE IS "..."Events including a specific attendee
CALENDAR IS "..."Events belonging to a named calendar

Updating Events

UPDATE ?ev modifies an existing event object. Multiple modifiers can be combined in a single update.

Update title
UPDATE ?ev
SET TITLE TO "New Title"
Move time
UPDATE ?ev
MOVE TO "2026-07-02" FROM "10:00" TO "11:00"
Combined update
UPDATE ?ev
SET TITLE TO "New Title"
MOVE TO "2026-07-02" FROM "10:00" TO "11:00"
ADD ATTENDEE "carol@co.com"
REMOVE ATTENDEE "bob@co.com"

Removing Events

REMOVE EVENT deletes a single occurrence. AND ALL OCCURRENCES removes the entire recurring series.

Remove
REMOVE EVENT ?ev SET ?n
AFTER EMIT "removed: " & ?n
(* AND ALL OCCURRENCES removes the whole recurring series instead of one date *)
AFTER REMOVE EVENT ?series AND ALL OCCURRENCES SET ?total

Calendars

A calendar is a named container for events. Events created without specifying a calendar go into the default calendar.

Create, list, drop
NEW CALENDAR "Work"
WITH DESCRIPTION "Work schedule"
COLOR "#0057FF"
SET ?cal

AFTER LIST CALENDARS SET ?all
AFTER EMIT ?all

AFTER DROP CALENDAR ?cal SET ?n

Availability & Booking

CHECK AVAILABILITY returns an array of free slots of the requested duration within the given range. BOOK SLOT converts a slot into a confirmed event.

Check and book
CHECK AVAILABILITY FROM "2026-07-01" TO "2026-07-07" FOR 30 MINUTES SET ?slots
AFTER EMIT ?slots

AFTER BOOK SLOT ?slots(0)
WITH NAME "Carol"
AND EMAIL "carol@example.com"
SET ?booking
AFTER EMIT ?booking("id")

Export & Import

Export to iCal file
EXPORT CALENDAR ?cal TO FILE "/root/backup.ics" SET ?ical
AFTER EMIT "exported"
Import from iCal file
IMPORT CALENDAR FROM FILE "/root/events.ics" INTO ?cal SET ?n
AFTER EMIT "Imported: " & ?n & " events"

Event Object Fields

All fields accessed via ?ev("field").

Field Type Description
idstringUnique event ID
calendar_idstringParent calendar ID
titlestringEvent title
descriptionstringEvent description
locationstringEvent location
startsdateStart timestamp
endsdateEnd timestamp
timezonestringIANA timezone string
all_dayboolTrue if all-day event
attendeesarrayList of attendee email addresses
rrulestringRFC 5545 recurrence rule
series_idstringShared ID across all occurrences of a recurring event
created_atdateCreation timestamp

Quick Reference

Verb Returns
NEW EVENT "title"Event object
GET EVENT ?idEvent object
GET EVENTS TODAYArray of events
GET EVENTS THIS WEEKArray of events
GET EVENTS THIS MONTHArray of events
GET EVENTS FROM "date" TO "date"Array of events
GET EVENTS ... WHERE ...Array of events
GET NEXT EVENTNext event or null
UPDATE ?evTrue
REMOVE EVENT ?evCount deleted
REMOVE EVENT ?ev AND ALL OCCURRENCESCount deleted
NEW CALENDAR "name"Calendar object
LIST CALENDARSArray of calendars
DROP CALENDAR ?calCount deleted
CHECK AVAILABILITY FROM ... TO ... FOR ...Array of free slots
BOOK SLOT ?slot WITH NAME ... AND EMAIL ...Event object
EXPORT CALENDAR ?cal TO FILE "..."iCal string
IMPORT CALENDAR FROM FILE "..." INTO ?calCount imported