dynamic / silverstripe-elemental-dynamic-calendar
A calendar element for the SilverStripe Elemental module
Package info
github.com/dynamic/silverstripe-elemental-dynamic-calendar
Type:silverstripe-vendormodule
pkg:composer/dynamic/silverstripe-elemental-dynamic-calendar
Requires
- php: ^8.3
- dnadesign/silverstripe-elemental: ^6.0
- dynamic/silverstripe-calendar: ^3.0
Requires (Dev)
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-07 06:36:01 UTC
README
Requirements
- dynamic/dynamic-calendar: ^3@dev
- dnadesign/silverstripe-elemental: ^4@dev
Installation
composer require dynamic/silverstripe-elemental-dynamic-calendar
Example usage
A block that displays upcoming events.
Template Notes
The default templates are based off Bootstrap 4 classes/styling.
Getting more elements
See Elemental modules by Dynamic
Configuration
See SilverStripe Elemental Configuration
Calendar block event window
Dynamic\Elements\Calendar\Elements\ElementCalendar bounds how far it asks
dynamic/silverstripe-calendar for events. The server-side list feeds the block's summary
text and the CMS block schema; the events themselves are fetched in the browser from the
calendar's own /<calendar>/events endpoint. Without a bound, every uncached call expanded
the calendar's whole event corpus - and every recurring occurrence in it - just to show a
few upcoming events.
# any _config/*.yml in your project Dynamic\Elements\Calendar\Elements\ElementCalendar: events_window_months: 6 events_window_backfill_days: 1
events_window_months(default6): how far ahead, in months, the feed is fetched. The window closes at the end of that month. Set it to0- or any non-positive value - to disable the bound and restore the unbounded fetch.events_window_backfill_days(default1): how many days before today the window reaches back, so an event that started yesterday and has not finished is still listed. Set it to0to start the window exactly today.
Both bounds are applied to StartDate only, because Calendar::getEventsFeed() filters on
StartDate only. That has one consequence worth knowing about:
events_window_backfill_days keeps a running event visible only if it started within
that many days before today. An event that started earlier and is still running - a
week-long festival on its fourth day - is left out. Raise
events_window_backfill_days to at least the longest event duration on the site to work
around it; a proper "started before today but not yet finished" overlap mode is tracked
upstream in dynamic/silverstripe-calendar#267
and this module will adopt it there.
When the window is enabled (a positive events_window_months), events whose end date falls
before today are dropped from the window before the block's Limit is applied, so a
finished event inside the backfill period cannot take a display slot away from an upcoming
one. That drop is part of the bounded path only: with events_window_months: 0 the fetch is
unbounded and past events are kept, as before. The date comparison ignores time of day, so
an event that ends today stays listed until tomorrow.