Microsoft 365 FullCalendar
This module displays a user's Microsoft 365 calendar within a Drupal view using FullCalendar. It fetches calendar events on demand, respecting privacy settings and allowing for customization through CSS and hooks.
Shows the signed-in user's Microsoft 365 (Outlook) calendar inside a
FullCalendar view,
alongside the Drupal content that view already renders.
A site builder enables it per display: open a view whose format is
FullCalendar, expand Microsoft 365 calendar, and tick
Show Microsoft 365 events. FullCalendar then fetches only the
visible date range on every navigation, so a year of appointments is never
loaded to show one week.
Features
- Personal calendar of the signed-in user, read-only, via Microsoft Graph
/me/calendarView, so recurring series arrive already expanded
into individual occurrences. - Lazy per-range loading driven by FullCalendar itself. No custom
JavaScript, and no patch to the FullCalendar module. - Private and confidential appointments show as "Busy" with no
subject, location or meeting link. On by default, switchable per
display. - Optional filtering on Outlook's free/busy status, and hiding of cancelled
appointments. - Per-status CSS classes, so a theme can style tentative, out-of-office and
cancelled appointments distinctly. hook_o365_fullcalendar_event_alter()for modules that need to
reshape an event before it reaches the browser.- An example view ships as optional configuration, so there is something
working to look at immediately after install. - Degrades quietly: an expired token or a Graph outage leaves the calendar
rendering its Drupal events, never an error page.
Requirements
- Microsoft 365 Connector
with the Microsoft 365 SSO submodule configured. Each user
must have signed in through it; users without ano365_sso
authmap entry simply see no Microsoft 365 events. - FullCalendar 4.x
and its JavaScript library. - Drupal 11.1 or newer. The module uses attribute-based hook discovery,
which core only supports from 11.1. Note this is narrower than
o365itself, which still supports Drupal 10.
Configuration
Per-display settings live on the FullCalendar format settings of each view.
Site-wide guard rails — the maximum date range a single request may span, the
maximum number of events requested from Graph, and how long results are cached
— live at
Administration › Configuration › System › Microsoft 365
› FullCalendar.
Customising how an event looks
FullCalendar draws events in JavaScript from a JSON feed, so there is no Twig
template per event. There are three levers instead, in increasing order of
power:
- CSS. Every event carries
o365-eventplus a
status class —o365-event--busy,--free,
--tentative,--oof,
--workingElsewhere— ando365-event--cancelled
where it applies. - PHP. Implement
hook_o365_fullcalendar_event_alter()to change the title,
colour, classes or extra data. Seeo365_fullcalendar.api.php.
Implementations must respect the masking the module has already applied. - JavaScript. Listen for the
fullcalendar:preBuildDOM event that FullCalendar 4.x
dispatches and setcalendarOptions.eventContentto render your
own markup, readingextendedProps.o365for the location and
meeting link.
Privacy
Each user only ever sees their own calendar; the module only ever calls
Graph's /me/ endpoints. The HTTP response is marked
private, no-store and never enters a shared or CDN cache. The raw
Graph payload is cached server-side, keyed per user, for a configurable
interval; set cache_ttl to 0 to disable that
entirely.
Related modules
- Microsoft 365 Connector
— the Graph client and SSO this module builds on. - FullCalendar —
the Views style plugin this module extends.