PHPackages                             flopezlosada/calendar-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. flopezlosada/calendar-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

flopezlosada/calendar-bundle
============================

This bundle allows you to integrate the jQuery FullCalendar plugin into your Symfony2 application.

1.1.3(6y ago)118MITPHP

Since Jun 7Pushed 4d agoCompare

[ Source](https://github.com/flopezlosada/calendar-bundle)[ Packagist](https://packagist.org/packages/flopezlosada/calendar-bundle)[ Docs](http://github.com/adesigns/calendar-bundle)[ RSS](/packages/flopezlosada-calendar-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (9)Versions (11)Used By (0)

CalendarBundle - jQuery FullCalendar bundle.
============================================

[](#calendarbundle---jquery-fullcalendar-bundle)

[![Latest Stable Version](https://camo.githubusercontent.com/ec83e7f5d3c623cc73fe0ad775552f4de94db8cacba10221e2e4adcc059e5faf/68747470733a2f2f706f7365722e707567782e6f72672f6164657369676e732f63616c656e6461722d62756e646c652f762f737461626c65)](https://packagist.org/packages/adesigns/calendar-bundle) [![Total Downloads](https://camo.githubusercontent.com/8469bd6a6529154c41afb8aebd65cb98b133f1f23c3a6d06c64981a0b8674ee6/68747470733a2f2f706f7365722e707567782e6f72672f6164657369676e732f63616c656e6461722d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/adesigns/calendar-bundle) [![Latest Unstable Version](https://camo.githubusercontent.com/3ba744c628784e61320a1268e89b277ec2b350c2dd312a9a11deaa03233b47a6/68747470733a2f2f706f7365722e707567782e6f72672f6164657369676e732f63616c656e6461722d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/adesigns/calendar-bundle) [![License](https://camo.githubusercontent.com/667f8415c380d3416f45da1896380fc7977928a8715096491527a6cbd471d004/68747470733a2f2f706f7365722e707567782e6f72672f6164657369676e732f63616c656e6461722d62756e646c652f6c6963656e7365)](https://packagist.org/packages/adesigns/calendar-bundle)

This bundle allows you to integrate the [jQuery FullCalendar](http://arshaw.com/fullcalendar/) plugin into your Symfony2 application.

Once installed, this bundle will use event listeners to load events from any bundle in your application.

Installation
------------

[](#installation)

Before installing, please note that this bundle has a dependency on the [FOSJsRouting](https://github.com/FriendsOfSymfony/FOSJsRoutingBundle) bundle to expose the calendar AJAX event loader route. Please ensure that the FOSJsRouting bundle is installed and configured before continuing.

### Through Composer (Symfony 2.1+):

[](#through-composer-symfony-21)

Add the following lines in your `composer.json` file:

```
composer require adesigns/calendar-bundle
```

Register the bundle in `app/AppKernel.php`:

```
// app/AppKernel.php

public function registerBundles()
{
    return array(
        // ...
        new ADesigns\CalendarBundle\ADesignsCalendarBundle(),
    );
}
```

Register the routing in `app/config/routing.yml`:

```
# app/config/routing.yml

adesigns_calendar:
  resource: "@ADesignsCalendarBundle/Resources/config/routing.xml"
```

Publish the assets:

```
$ php app/console assets:install web

```

Usage
-----

[](#usage)

Add the required stylesheet and javascripts to your layout:

Stylesheet:

```

```

Javascript:

```

```

Then, in the template where you wish to display the calendar, add the following twig:

```
{% include 'ADesignsCalendarBundle::calendar.html.twig' %}

```

Adding Events
-------------

[](#adding-events)

The best part about this bundle is that you can add events to the calendar from any part of your application. The calendar loads events via AJAX, and dispatches an event to load calendar events from your application.

When a request is made to load events for a given start/end time, the bundle dispatches a `calendar.load_events` event. Adding event listeners is an easy 2 step process

Create an Event Listener class in your bundle:

```
// src/Acme/DemoBundle/EventListener/CalendarEventListener.php

namespace Acme\DemoBundle\EventListener;

use ADesigns\CalendarBundle\Event\CalendarEvent;
use ADesigns\CalendarBundle\Entity\EventEntity;
use Doctrine\ORM\EntityManager;

class CalendarEventListener
{
	private $entityManager;

	public function __construct(EntityManager $entityManager)
	{
		$this->entityManager = $entityManager;
	}

	public function loadEvents(CalendarEvent $calendarEvent)
	{
		$startDate = $calendarEvent->getStartDatetime();
		$endDate = $calendarEvent->getEndDatetime();

		// The original request so you can get filters from the calendar
        // Use the filter in your query for example

     	$request = $calendarEvent->getRequest();
        $filter = $request->get('filter');

		// load events using your custom logic here,
		// for instance, retrieving events from a repository

		$companyEvents = $this->entityManager->getRepository('AcmeDemoBundle:MyCompanyEvents')
			              ->createQueryBuilder('company_events')
			              ->where('company_events.event_datetime BETWEEN :startDate and :endDate')
			              ->setParameter('startDate', $startDate->format('Y-m-d H:i:s'))
			              ->setParameter('endDate', $endDate->format('Y-m-d H:i:s'))
			              ->getQuery()->getResult();

	    // $companyEvents and $companyEvent in this example
	    // represent entities from your database, NOT instances of EventEntity
	    // within this bundle.
	    //
	    // Create EventEntity instances and populate it's properties with data
	    // from your own entities/database values.

		foreach($companyEvents as $companyEvent) {

		    // create an event with a start/end time, or an all day event
		    if ($companyEvent->getAllDayEvent() === false) {
		    	$eventEntity = new EventEntity($companyEvent->getTitle(), $companyEvent->getStartDatetime(), $companyEvent->getEndDatetime());
		    } else {
		    	$eventEntity = new EventEntity($companyEvent->getTitle(), $companyEvent->getStartDatetime(), null, true);
		    }

		    //optional calendar event settings
		    $eventEntity->setAllDay(true); // default is false, set to true if this is an all day event
		    $eventEntity->setBgColor('#FF0000'); //set the background color of the event's label
		    $eventEntity->setFgColor('#FFFFFF'); //set the foreground color of the event's label
		    $eventEntity->setUrl('http://www.google.com'); // url to send user to when event label is clicked
		    $eventEntity->setCssClass('my-custom-class'); // a custom class you may want to apply to event labels

		    //finally, add the event to the CalendarEvent for displaying on the calendar
		    $calendarEvent->addEvent($eventEntity);
		}
	}
}
```

Additional properties and customization of each event on the calendar can be found in the Entity/EventEntity class.

Then, add the listener to your services:

```

```

And that's it! When the `ADesignsCalendarBundle::calendar.html.twig` template is rendered, any events within the current month/day/year will be pulled from your application.

Extending the Calendar Javascript
---------------------------------

[](#extending-the-calendar-javascript)

You may want to customize the FullCalendar javascript to meet your applications needs. In order to do this, you can copy the calendar-settings.js in Resources/public/js, and modify it to fit your needs. For instance, you can pass custom filters to your event listeners by adding extra parameters in the eventSources method:

```
eventSources: [
        {
            url: Routing.generate('fullcalendar_loader'),
            type: 'POST',
            // A way to add custom filters to your event listeners
            data: {
                filter: 'my_custom_filter_param'
            },
            error: function() {
               //alert('There was an error while fetching Google Calendar!');
            }
        }
]
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance65

Regular maintenance activity

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 74.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~395 days

Recently: every ~488 days

Total

7

Last Release

2349d ago

Major Versions

1.1.3 → 2.0.x-dev2019-12-04

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/30365874?v=4)[Francisco López](/maintainers/flopezlosada)[@flopezlosada](https://github.com/flopezlosada)

---

Top Contributors

[![mikeyudin](https://avatars.githubusercontent.com/u/981848?v=4)](https://github.com/mikeyudin "mikeyudin (46 commits)")[![flopezlosada](https://avatars.githubusercontent.com/u/30365874?v=4)](https://github.com/flopezlosada "flopezlosada (10 commits)")[![arendjantetteroo](https://avatars.githubusercontent.com/u/713066?v=4)](https://github.com/arendjantetteroo "arendjantetteroo (2 commits)")[![ajouve](https://avatars.githubusercontent.com/u/2337492?v=4)](https://github.com/ajouve "ajouve (1 commits)")[![rdohms](https://avatars.githubusercontent.com/u/94331?v=4)](https://github.com/rdohms "rdohms (1 commits)")[![remyj38](https://avatars.githubusercontent.com/u/1536771?v=4)](https://github.com/remyj38 "remyj38 (1 commits)")[![varavan](https://avatars.githubusercontent.com/u/761880?v=4)](https://github.com/varavan "varavan (1 commits)")

---

Tags

calendarfullcalendarjquery calendar

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/flopezlosada-calendar-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/flopezlosada-calendar-bundle/health.svg)](https://phpackages.com/packages/flopezlosada-calendar-bundle)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[wallabag/wallabag

open source self hostable read-it-later web application

12.6k2.2k](/packages/wallabag-wallabag)[tattali/calendar-bundle

Provides event calendar for your Symfony 8+ project. Compatible with API like Google Calendar.

166545.6k](/packages/tattali-calendar-bundle)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[edofre/yii2-fullcalendar

Yii2 widget for fullcalendar

2761.7k1](/packages/edofre-yii2-fullcalendar)[edofre/laravel-fullcalendar

Laravel component for fullcalendar package

591.8k](/packages/edofre-laravel-fullcalendar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
