Calendar 366
Calendar 366 is a calendar and tasks app for iPhone, iPad, Apple Watch, and Mac. Protocol Launcher allows you to generate Calendar 366 URL scheme links to add events and tasks, open items, show views, summarize, and import calendars.
Usage
There are two ways to use this library:
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
- Full Import from the root package is convenient but includes all app modules.
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
Select Installation Method
Add Event or Task
Calendar 366 documents cal366://add with type set to event or task, and an optional natural-language query. addEvent() and addTask() are thin helpers around the same official command.
import { add, addEvent, addTask } from 'protocol-launcher/calendar-366'
const eventUrl = add({
type: 'event',
query: 'Meeting tomorrow 10am',
})
const eventShortcutUrl = addEvent({
query: 'Meeting tomorrow 10am',
})
const taskUrl = addTask({
query: 'Call dentist',
})Open Item
Open an event or task by calendarItemExternalIdentifier or identifier. Calendar 366 documents date as optional for tasks.
import { openItem } from 'protocol-launcher/calendar-366'
const eventUrl = openItem({
type: 'event',
id: 'ABC123',
})
const taskUrl = openItem({
type: 'task',
id: 'TASK123',
date: 1717200000,
})Show View, Tasks, or Date
Use view with one of Calendar 366's documented view names, tasks with the official task-list number, and date as timeIntervalSince1970.
import { show } from 'protocol-launcher/calendar-366'
const monthUrl = show({
view: 'month',
})
const overdueTasksUrl = show({
tasks: 1,
})
const dayUrl = show({
view: 'day',
date: 1717200000,
})Summarize
import { summarize } from 'protocol-launcher/calendar-366'
const url = summarize()Import Calendar
Calendar 366 documents file:// and https:// calendar file URLs.
import { importCalendar } from 'protocol-launcher/calendar-366'
const url = importCalendar({
url: 'https://example.com/calendar.ics',
})Generated URLs
add({ type: 'event', query: 'Meeting tomorrow 10am' })
// => 'cal366://add?type=event&query=Meeting%20tomorrow%2010am'
addEvent({ query: 'Meeting tomorrow 10am' })
// => 'cal366://add?type=event&query=Meeting%20tomorrow%2010am'
addTask({ query: 'Call dentist' })
// => 'cal366://add?type=task&query=Call%20dentist'
openItem({ type: 'event', id: 'ABC123' })
// => 'cal366://open?type=event&id=ABC123'
openItem({ type: 'task', id: 'TASK123', date: 1717200000 })
// => 'cal366://open?type=task&id=TASK123&date=1717200000'
show({ view: 'month' })
// => 'cal366://show?view=month'
show({ tasks: 1 })
// => 'cal366://show?tasks=1'
show({ view: 'day', date: 1717200000 })
// => 'cal366://show?view=day&date=1717200000'
summarize()
// => 'cal366://summarize'
importCalendar({ url: 'https://example.com/calendar.ics' })
// => 'cal366://import?url=https%3A%2F%2Fexample.com%2Fcalendar.ics'