tattali / calendar-bundle
Provides event calendar for your Symfony 8+ project. Compatible with API like Google Calendar.
Package info
github.com/tattali/CalendarBundle
Type:symfony-bundle
pkg:composer/tattali/calendar-bundle
Fund package maintenance!
Requires
- php: >=8.4
- ext-json: *
- symfony/config: ^8.0
- symfony/dependency-injection: ^8.0
- symfony/event-dispatcher: ^8.0
- symfony/framework-bundle: ^8.0
- symfony/http-foundation: ^8.0
- symfony/http-kernel: ^8.0
- symfony/yaml: ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.90
- infection/infection: ^0.35
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^12.4
- shipmonk/composer-dependency-analyser: ^1.8
Suggests
- doctrine/mongodb-odm-bundle: To support MongoDB.
- symfony/orm-pack: To support Doctrine ORM and Migration.
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 8.x-dev
- v8.3.0
- v8.2.2
- v8.2.1
- v8.2.0
- v8.1.1
- v8.1.0
- v8.0.0
- 7.x-dev
- v7.0.5
- v7.0.4
- v7.0.3
- v7.0.2
- v7.0.1
- v7.0.0
- 6.x-dev
- v6.0.0
- 5.x-dev
- v5.0.0
- v1.3.0
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0
- dev-raise-dev-tool-minimums
- dev-event-dates-datetimeinterface
This package is auto-updated.
Last update: 2026-11-05 07:57:24 UTC
README
This bundle allow you to integrate FullCalendar.js library in your Symfony 8 project.
Versions
Each major version of the bundle supports one Symfony major version:
| Bundle | Branch | Symfony | PHP |
|---|---|---|---|
| 8.x | main | 8 | 8.4+ |
| 7.x | 7.x | 7 | 8.2+ |
| 6.x | 6.x | 6.4 | 8.1+ |
| 5.x | 5.x | 5.4 | 8.0+ |
| 1.x | tags v1.* |
3.4 to 7 | 7.1+ |
New features go to main. The 7.x and 6.x branches get bug fixes, and 5.x gets security fixes only.
Documentation
The source of the documentation is stored in the docs/ folder in this bundle
Installation
composer require tattali/calendar-bundle
Import the routes:
# config/routes/calendar.yaml calendar: resource: '@CalendarBundle/config/routing.yaml'
Quick Start
Create a subscriber to populate calendar data:
// src/EventSubscriber/CalendarSubscriber.php <?php namespace App\EventSubscriber; use CalendarBundle\Entity\Event; use CalendarBundle\Event\SetDataEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class CalendarSubscriber implements EventSubscriberInterface { public static function getSubscribedEvents(): array { return [ SetDataEvent::class => 'onCalendarSetData', ]; } public function onCalendarSetData(SetDataEvent $setDataEvent): void { $start = $setDataEvent->getStart(); $end = $setDataEvent->getEnd(); $filters = $setDataEvent->getFilters(); // You may want to make a custom query from your database to fill the calendar $setDataEvent->addEvent(new Event( 'Event title', new \DateTime('Tuesday this week'), new \DateTime('Wednesday this week') )); // If the end date is null or not defined, it creates a all day event $setDataEvent->addEvent(new Event( 'All day event', new \DateTime('Friday this week') )); } }
Add the calendar to your template:
{% block body %}
<div id="calendar-holder"></div>
{% endblock %}
{% block javascripts %}
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.11/index.global.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
new FullCalendar.Calendar(document.getElementById('calendar-holder'), {
initialView: 'dayGridMonth',
eventSources: [{
url: '/fc-load-events',
method: 'POST',
extraParams: { filters: JSON.stringify({}) }
}]
}).render();
});
</script>
{% endblock %}
Documentation
- Configuration - Caching, JSON depth limit, routing
- Doctrine CRUD - Create, update, delete events with Doctrine
- Webpack Encore - ES6 module setup
- Multi-calendar - Multiple calendars on one page
- Security - Securing the endpoint
- Time zones - FullCalendar
timeZoneparameter and all-day dates
Upgrade Guides
Troubleshooting
Debug AJAX requests using browser Network monitor (Ctrl+Shift+E Firefox, Ctrl+Shift+I Chrome).
License
MIT - See LICENSE
