Skip to content

Calendar 0.1.0: A personal calendar for every user

Calendar 0.1.0 is the first release of PhoenixKit’s calendar module. Every user of your Phoenix app gets a personal calendar, and permissions decide who may see or edit anyone else’s.

The calendar page

The Calendar page at /admin/calendar shows a month view that works without JavaScript. New event opens a form for timed or all-day events with a status, a colour, a location and a description. Times are stored in UTC and shown in the viewer’s timezone. When you edit someone in another timezone, the form says so and offers Use their timezone.

The Calendars panel lets a user with access switch to another person’s calendar or lay it over their own. Changes show up live in other open tabs.

Participants

An event can have participants: platform users, staff and CRM contacts, found through one search box (Search people…). The same person found in several places is listed once.

Permissions

The Calendar permission gives a user their own calendar. Sub-permissions add the rest: View other users’ calendars, Edit other users’ calendars, Invite platform users, Invite staff and Invite CRM contacts. The Owner has everything; Admin has everything by default.

Dashboard widgets

Three widgets for the Dashboards module, each showing only the viewer’s own calendar: Upcoming events, Today’s agenda and Mini month. Every change to an event is written to the activity log.

Getting started

Add {:phoenix_kit_calendar, "~> 0.1"}, run mix deps.get and mix phoenix_kit.update (the events table comes with core migration V141), then enable the module on /admin/modules. Calendar 0.1 needs PhoenixKit core 1.7.179 or later in the 1.7 series.

Full release notes: Calendar 0.1.0

0.1.0 · 11 July 2026

Initial release. Personal calendars for PhoenixKit — one implicit calendar per user, with fine-grained sub-permissions (calendar.view_others / calendar.edit_others) controlling access to other people’s calendars.

Added

  • Web.CalendarLive (/admin/calendar) — month view via phoenix_live_calendar‘s CalendarComponent, create/edit/delete modals, a “Calendars” panel for switching or overlaying other users’ calendars (permission-gated), and live cross-tab updates via a scoped PubSub topic.
  • Events context — the authorization boundary for all calendar reads and mutations. Every function authorizes against the target calendar’s owner via Scope.can?/2; mutations are load-then-authorize against the persisted owner, and owner_uuid is never cast from user-supplied attrs.
  • Timed and all-day events (starts_at/ends_at vs starts_on/ends_on, exclusive end, iCal-style), stored in true UTC and displayed/entered in the viewer’s offset-hours timezone, with a cross-timezone indicator + explicit “Use their timezone” entry mode when editing another owner’s calendar.
  • Participants — invite platform users, staff, or CRM contacts to an event via a cross-source search picker with load-more pagination, cross-source de-duplication (linked user > staff > CRM contact), and source-level invite permission gating.
  • Three dashboard widgets (calendar.upcoming, calendar.today, calendar.mini_month) via the duck-typed phoenix_kit_widgets/0 contract, each scoped strictly to the viewer’s own calendar and rendering defensively (nil scope/settings/size never crashes the host dashboard).
  • Activity logging on every mutation (calendar_event.created/updated/deleted).

Fixed

  • Dashboard widgets (Upcoming, Today) sorted events by default term order on a DateTime struct instead of chronologically, which silently broke “soonest first” / “all-day first” whenever the event set crossed a month boundary. Both now sort with an explicit DateTime comparator.
  • CalendarLive.mount/3 ran an ungated database query for the people panel that never refreshed for the life of the socket (a stale roster after mount) and duplicated on the disconnected+connected mount pair. The load now happens in handle_params/3, in line with the rest of the LiveView’s fresh-scope-on-every-navigation convention.
  • Events.tap_log/4 ran activity logging and the PubSub live-update broadcast in the same rescue block, so a logging failure could silently suppress the broadcast too. The two are now isolated from each other.

Calendar 0.1.0. Install or update: {:phoenix_kit_calendar, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.