-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
404 additions
and
512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
/build/ | ||
/vendor/ | ||
.DS_Store | ||
.php_cs.cache | ||
.phpunit.result.cache | ||
composer.lock | ||
.phpunit.cache | ||
|
||
# phpunit | ||
/build/ | ||
.phpunit.result.cache | ||
|
||
# php-cs-fixer | ||
.php-cs-fixer.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
$config = new PhpCsFixer\Config(); | ||
|
||
return $config | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@PhpCsFixer' => true, | ||
'@PhpCsFixer:risky' => true, | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
|
||
'@PSR1' => true, | ||
'@PER-CS2.0' => true, | ||
'@PER-CS2.0:risky' => true, | ||
|
||
'php_unit_internal_class' => false, | ||
'php_unit_test_class_requires_covers' => false, | ||
]) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->in(__DIR__) | ||
->exclude([ | ||
'vendor', | ||
]) | ||
) | ||
; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
all: install test | ||
|
||
install: | ||
composer install | ||
|
||
test: | ||
vendor/bin/phpunit | ||
|
||
lint_php: | ||
vendor/bin/php-cs-fixer fix --ansi -v | ||
|
||
lint_php_dry: | ||
vendor/bin/php-cs-fixer fix --ansi -v --dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ Check the existence of the file `config/routes/calendar.yaml` or create it | |
```yaml | ||
# config/routes/calendar.yaml | ||
calendar: | ||
resource: "@CalendarBundle/Resources/config/routing.yaml" | ||
resource: '@CalendarBundle/Resources/config/routing.yaml' | ||
``` | ||
#### 2. Create the subscriber | ||
|
@@ -66,34 +66,34 @@ namespace App\EventSubscriber; | |
|
||
use CalendarBundle\CalendarEvents; | ||
use CalendarBundle\Entity\Event; | ||
use CalendarBundle\Event\CalendarEvent; | ||
use CalendarBundle\Event\SetDataEvent; | ||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
|
||
class CalendarSubscriber implements EventSubscriberInterface | ||
{ | ||
public static function getSubscribedEvents() | ||
{ | ||
return [ | ||
CalendarEvents::SET_DATA => 'onCalendarSetData', | ||
SetDataEvent::class => 'onCalendarSetData', | ||
]; | ||
} | ||
|
||
public function onCalendarSetData(CalendarEvent $calendar) | ||
public function onCalendarSetData(SetDataEvent $event) | ||
{ | ||
$start = $calendar->getStart(); | ||
$end = $calendar->getEnd(); | ||
$filters = $calendar->getFilters(); | ||
$start = $event->getStart(); | ||
$end = $event->getEnd(); | ||
$filters = $event->getFilters(); | ||
|
||
// You may want to make a custom query from your database to fill the calendar | ||
|
||
$calendar->addEvent(new Event( | ||
$event->addEvent(new Event( | ||
'Event 1', | ||
new \DateTime('Tuesday this week'), | ||
new \DateTime('Wednesdays this week') | ||
)); | ||
|
||
// If the end date is null or not defined, it creates a all day event | ||
$calendar->addEvent(new Event( | ||
$event->addEvent(new Event( | ||
'All day event', | ||
new \DateTime('Friday this week') | ||
)); | ||
|
@@ -115,14 +115,14 @@ Add styles and js. Click [here](https://fullcalendar.io/download) to see other c | |
|
||
```twig | ||
{% block javascripts %} | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].5/index.global.min.js" integrity="sha256-dHUNnePy81fXq4D/wfu7cPsEIP7zl6MvLb84jtZf+UY=" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].11/index.global.min.js"></script> | ||
{% endblock %} | ||
``` | ||
|
||
### Basic functionalities | ||
|
||
You will probably want to customize the Calendar javascript to fit the needs of your application. | ||
To do this, you can copy the following settings and modify them by consulting the [fullcalendar.js documentation](https://fullcalendar.io/docs). You can also look at the [options.ts](https://github.com/fullcalendar/fullcalendar/blob/master/src/core/options.ts) file as an option reference. | ||
To do this, you can copy the following settings and modify them by consulting the [fullcalendar.js documentation](https://fullcalendar.io/docs). | ||
```js | ||
document.addEventListener('DOMContentLoaded', () => { | ||
var calendarEl = document.getElementById('calendar-holder'); | ||
|
@@ -132,13 +132,13 @@ document.addEventListener('DOMContentLoaded', () => { | |
editable: true, | ||
eventSources: [ | ||
{ | ||
url: "/fc-load-events", | ||
method: "POST", | ||
url: '/fc-load-events', | ||
method: 'POST', | ||
extraParams: { | ||
filters: JSON.stringify({}) | ||
}, | ||
failure: () => { | ||
// alert("There was an error while fetching FullCalendar!"); | ||
// alert('There was an error while fetching FullCalendar!'); | ||
}, | ||
}, | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.