@absolutejs/calendar
v0.2.0
Published
Date-only calendar ranges and layouts for AbsoluteJS applications
Readme
@absolutejs/calendar
Framework-independent, date-only calendar mechanics for AbsoluteJS apps. Apps own event models, permissions, interactions and persistence.
Exports: isCalendarDate, addDays, addMonths (clamps the day), dateInZone, weekDates, monthDates (42 cells), formatCalendarDate, and groupByDate (includes an undated bucket). Dates use YYYY-MM-DD; arithmetic and display avoid local-time/DST shifts. Week starts are configurable from Sunday (0) through Saturday (6). dateInZone is the explicit bridge from an instant to a calendar day.
import { monthDates, groupByDate } from '@absolutejs/calendar';
const cells = monthDates('2026-09-24');
const { days, undated } = groupByDate(tasks, task => task.due);No provider calendars, timers, React or storage dependencies are required. Invalid date input throws for arithmetic and is retained in the undated bucket when grouping.
Provider publishing (server only)
@absolutejs/calendar/providers exports createCalendarPublisher and
CalendarProviderError. Supply a Google or Microsoft owner-scoped access token from
Auth and a stable UUID event key. publish({ key, title, date, description }, eventId?)
creates or updates a private all-day event in the account's primary calendar;
remove(key, eventId?) is idempotent. Persist the UUID before calling the provider,
then persist the returned ID. Google uses a deterministic event ID; Microsoft uses
both transactionId and a queryable extended property to recover ambiguous writes.
Requests time out after 20 seconds, reject redirects and expose sanitized errors.
There are no attendees, invitations, default reminders or blocked busy time.
Apps own permissions, explicit publication intent, durable scheduling and retention. Auth owns refresh and revocation. This adapter never reads mailbox content or stores credentials. Use a fresh UUID after a completed removal when publishing again.
