Thank you for being patient! We're working hard on resolving the issue
Calendars connect external calendar providers (Google Calendar, Apple Calendar, etc.) to Lona via OAuth. Each connected account appears as a calendar row in your sheet with child rows for different views.
A calendar row represents a connected calendar. Its children are:
| Type | Description |
|---|---|
calendar-list | List view of events |
timeline | All-day events |
calendar-month | Month grid view |
const calendar = sheet.row({ type: "calendar" });
console.log(calendar?.lookupKey); // e.g., ":~calendar"
client.calendars manages connected calendars, their display metadata,
and visibility preferences.
// Fetch from API (typically done once at app startup)
await client.calendars.fetch(userId);
// Or initialize with pre-fetched data (tests, offline)
client.calendars.initializeWith(userId, calendarLists);
// All calendar lists (grouped by auth account)
const allCalendars = client.calendars.listAll();
// Only visible calendars
const visible = client.calendars.listVisible();
// Primary auth account
const primaryAuth = client.calendars.primaryAuth();
// Primary calendar
const primary = client.calendars.primary();
const primaryId = client.calendars.primaryId();
import { AuthScopedCalendarId } from "@tento-lona";
const acid: AuthScopedCalendarId = [authId, calendarId];
const calendar = client.calendars.find(acid);
if (calendar) {
const [authId, display] = calendar;
console.log(display.summary); // "Work Calendar"
}
Calendars are visible by default. Toggle visibility to hide/show calendars in the UI:
// Check visibility
const visible = client.calendars.isVisible(acid);
// Toggle
client.calendars.setVisible(acid, false);
Visibility changes are persisted to user preferences and broadcast via the invalidation system.
Get calendars the user can write to (for "move event" or "create event" UIs). Excludes a specific calendar and limits results:
const targets = client.calendars.writable(
currentCalendarAcid, // exclude current
5, // max results
);
for (const cal of targets) {
console.log(`${cal.summary} (${cal.authId}/${cal.calendarId})`);
}
const unsubscribe = client.calendars.onVisibilityChange(() => {
// Re-render calendar UI
});