Coder Social home page Coder Social logo

tattali / calendarbundle Goto Github PK

View Code? Open in Web Editor NEW
144.0 144.0 22.0 341 KB

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

Home Page: https://packagist.org/packages/tattali/calendar-bundle

License: MIT License

PHP 98.98% HTML 0.15% Makefile 0.87%
calendar composer symfony

calendarbundle's People

Contributors

chris53897 avatar chris8934 avatar freezy-sk avatar nelly34 avatar orkin avatar parijke avatar tacman avatar tattali avatar treeindark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calendarbundle's Issues

Cannot install to Symfony 5

Hello Everyone !

I need to install your bundle, but I end up with this error when installing on Symfony 5

Problem 1

tattali/calendar-bundle v1.1.6 requires symfony/dependency-injection ^3.4 || ^4.0

Thanks for your help

App\Entity\Booking object not found by the @ParamConverter annotation.

Hi,

I followed all steps, but finally I got

App\Entity\Booking object not found by the @ParamConverter annotation.

It is here:

{
"route": "booking_show",
"route_parameters": {
"_route": "booking_show",
"_controller": "App\Controller\BookingController::show",
"id": "calendar"
},
"request_uri": "http://127.0.0.1/dashboard/vacations/public/booking/calendar",
"method": "GET"
}

What I'm doing wrong?

composer.json
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.2.5",
"ext-ctype": "",
"ext-iconv": "
",
"sensio/framework-extra-bundle": "^5.1",
"symfony/apache-pack": "^1.0",
"symfony/asset": "5.0.",
"symfony/console": "5.0.
",
"symfony/dotenv": "5.0.",
"symfony/expression-language": "5.0.
",
"symfony/flex": "^1.3.1",
"symfony/form": "5.0.",
"symfony/framework-bundle": "5.0.
",
"symfony/http-client": "5.0.",
"symfony/intl": "5.0.
",
"symfony/mailer": "5.0.",
"symfony/monolog-bundle": "^3.1",
"symfony/notifier": "5.0.
",
"symfony/orm-pack": "",
"symfony/process": "5.0.
",
"symfony/security-bundle": "5.0.",
"symfony/serializer-pack": "
",
"symfony/string": "5.0.",
"symfony/translation": "5.0.
",
"symfony/twig-pack": "",
"symfony/validator": "5.0.
",
"symfony/web-link": "5.0.",
"symfony/yaml": "5.0.
",
"tattali/calendar-bundle": "^1.2"
},
"require-dev": {
"symfony/debug-pack": "",
"symfony/maker-bundle": "^1.0",
"symfony/profiler-pack": "
",
"symfony/test-pack": ""
},
"config": {
"preferred-install": {
"
": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\Tests\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.",
"symfony/polyfill-ctype": "
",
"symfony/polyfill-iconv": "",
"symfony/polyfill-php72": "
",
"symfony/polyfill-php71": "",
"symfony/polyfill-php70": "
",
"symfony/polyfill-php56": ""
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "
"
},
"extra": {
"symfony": {
"allow-contrib": true,
"require": "5.0.*"
}
}
}

image

Ordering Full Day Events

Thank you for this bundle, it works perfectly in my SF5 project.

Is there a way I can manipulate de ordering of full day events?
I want the grey one last, the red ones first and the green ones in the middle
image

Getting can not autowire service when using custom entity

I'm getting the error
Cannot autowire service "AppBundle\Entity\BusinessBooking": argument "$title" of method "CalendarBundle\Entity\Event::__construct()" is type-hinted "string", you should configure its value explicitly.

Here is my Calendar Subscriber:

<?php

namespace AppBundle\EventSubscriber;

use AppBundle\Entity\BusinessBooking;
use CalendarBundle\CalendarEvents;
//use CalendarBundle\Entity\Event;
use CalendarBundle\Event\CalendarEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

class CalendarSubscriber implements EventSubscriberInterface
{
    private $bookingRepository;
    private $router;

    public function __construct(
        BusinessBooking $bookingRepository,
        UrlGeneratorInterface $router
    ) {
        $this->bookingRepository = $bookingRepository;
        $this->router = $router;
    }

    public static function getSubscribedEvents()
    {
        return [
            CalendarEvents::SET_DATA => 'onCalendarSetData',
        ];
    }

    public function onCalendarSetData(CalendarEvent $calendar)
    {
        $start = $calendar->getStart();
        $end = $calendar->getEnd();
        $filters = $calendar->getFilters();

        // Modify the query to fit to your entity and needs
        // Change booking.beginAt by your start date property
        $bookings = $this->bookingRepository
            ->createQueryBuilder('b')
            ->where('b.datetime BETWEEN :start and :end')
            ->setParameter('start', $start->format('Y-m-d H:i:s'))
            ->setParameter('end', $end->format('Y-m-d H:i:s'))
            ->getQuery()
            ->getResult()
        ;

        foreach ($bookings as $booking) {
            // this create the events with your data (here booking data) to fill calendar
            $bookingEvent = new BusinessBooking(
                $title = $booking->getUid()->getUsername(),
                $start = $booking->getDatetime() ,
                $end = $booking->getDatetime()  // If the end date is null or not defined, a all day event is created.
            );
            

            $bookingEvent->setOptions([
                'backgroundColor' => 'red',
                'borderColor' => 'red',
            ]);
            $bookingEvent->addOption(
                'url',
                $this->router->generate('booking_show', [
                    'id' => $booking->getId(),
                ])
            );

            // finally, add the event to the CalendarEvent to fill the calendar
            $calendar->addEvent($bookingEvent);
        }
    }
}

My Entity BusinessBooking extends CalendarBundle\Entity\Event.

<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use \CalendarBundle\Entity\Event;

/**
 * @ORM\Entity(repositoryClass="AppBundle\Repository\BusinessBookingRepository")
 */
class BusinessBooking extends Event
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\User", inversedBy="businessBookings")
     * @ORM\JoinColumn(nullable=false)
     */
    private $uid;

    /**
     * @ORM\Column(type="datetime")
     */
    private $datetime;

    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Category")
     */
    private $itemCategory;

    /**
     * @ORM\Column(type="boolean", nullable=true)
     */
    private $isAccepted;

    /**
     * @ORM\Column(type="boolean", nullable=true)
     */
    private $isDone;

    /**
     * @ORM\Column(type="text", nullable=true)
     */
    private $message;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getUid(): ?User
    {
        return $this->uid;
    }

    public function setUid(?User $uid): self
    {
        $this->uid = $uid;

        return $this;
    }

    public function getDatetime(): ?\DateTimeInterface
    {
        return $this->datetime;
    }

    public function setDatetime(\DateTimeInterface $datetime): self
    {
        $this->datetime = $datetime;

        return $this;
    }

    public function getItemCategory(): ?Category
    {
        return $this->itemCategory;
    }

    public function setItemCategory(?Category $itemCategory): self
    {
        $this->itemCategory = $itemCategory;

        return $this;
    }

    public function getIsAccepted(): ?bool
    {
        return $this->isAccepted;
    }

    public function setIsAccepted(?bool $isAccepted): self
    {
        $this->isAccepted = $isAccepted;

        return $this;
    }

    public function getIsDone(): ?bool
    {
        return $this->isDone;
    }

    public function setIsDone(?bool $isDone): self
    {
        $this->isDone = $isDone;

        return $this;
    }

    public function getMessage(): ?string
    {
        return $this->message;
    }

    public function setMessage(?string $message): self
    {
        $this->message = $message;

        return $this;
    }
}

If I'm not extending Event in BusinessBooking Entity, I Get:
Attempted to call an undefined method named "createQueryBuilder" of class "AppBundle\Entity\BusinessBooking".

Entity Event add resourceId

Hi,
I use your bundle with fullcalendar 5.9 and it works perfectly. But I would like use it with fullcalendar-scheduler and I need an additional filed in Event entity like this:

/**
 * @var string
 */
protected $resourceId;

/**
* @var array
*/
protected $options = [];

public function __construct(
    string $title,
    DateTimeInterface $start,
    ?DateTimeInterface $end = null,
    ?string $resourceId = null,
    array $options = []
) {
    $this->setTitle($title);
    $this->setStart($start);
    $this->setEnd($end);
    $this->setResourceId($resourceId);
    $this->setOptions($options);
}

public function getResourceId(): ?string
{
    return $this->resourceId;
}

public function setResourceId(?string $resourceId): void
{
    $this->resourceId = $resourceId;
}

public function toArray(): array
{
    $event = [
        'title' => $this->getTitle(),
        'start' => $this->getStart()->format(self::DATE_FORMAT),
        'allDay' => $this->isAllDay(),
    ];

    if (null !== $this->getEnd()) {
        $event['end'] = $this->getEnd()->format(self::DATE_FORMAT);
    }

    if (null !== $this->getResourceId()) {
        $event['resourceId'] = $this->getResourceId();
    }
    return array_merge($event, $this->getOptions());
}

Is it possible to modify your bundle in this way ?
Thanks

Date au format français

Bonjour Tattali,

Merci beaucoup pour ce super outil.

Tout fonctionne bien sauf que j'ai essayé de franciser les champs de la route 8000/booking/new mais je ne vois pas où agir en ce qui concerne le formulaire en soi.

Du coup pour chaque nouvel événement, le formulaire affiche "begin at jan 1 2015" et je souhaiterais avoir le format français en affichant par défaut la date du jour ou au moins 2020.

Je souhaiterais aussi que pour les minutes on ne puisse choisir que par créneaux de 15mn mais pareil, je ne vois pas comment faire.

Je précise que je débute à peine dans le développement et je n'ai pas trouvé dans la doc comment faire.

Merci.

Data in ICS or ical format

Is there a way to output the event data as ICS or iCal? That would allow the data from this bundle to be integrate with Google Calendars and other calendars.

Long event not showing up in the middle

I have calendar that has allDay false for events in symfony installation and I'm using only week and day view
My event loader uses this

    public function findItemBookings($start, $end, $filters)
    {
        return $this->createQueryBuilder('booking')
            ->where('booking.beginAt BETWEEN :start and :end OR booking.endAt BETWEEN :start and :end')
            ->andWhere('booking.item = :itemId')
            ->setParameter('start', $start->format('Y-m-d H:i:s'))
            ->setParameter('end', $end->format('Y-m-d H:i:s'))
            ->setParameter('itemId', $filters['item'])
            ->getQuery()
            ->getResult()
        ;
    }

And I tested this:

document.addEventListener('DOMContentLoaded', function() {
  var calendarEl = document.getElementById('calendar');

  var calendar = new FullCalendar.Calendar(calendarEl, {
    initialView: 'timeGridWeek',
    initialDate: '2021-07-07',
    allDaySlot: false,        
    eventOverlap: false,
    selectOverlap: false,
    editable: false,
    headerToolbar: {
      left: 'prev,next today',
      center: 'title',
      right: 'dayGridMonth,timeGridWeek,timeGridDay'
    },
    events: [
      {
        allDay: false,
        title: 'Long Event',
        start: '2021-07-07T10:00:00',
        end: '2021-07-20T12:00:00'
      }
    ]
  });

  calendar.render();
});

and that it is working.

the problem

In week view I can see when the long event starts then I go to the next week the calendar is empty and then I go to the next week I can see the event ending. In day view it is the same problem. event shows up on the start and end dates.
I checked the js request and it is empty when the calendar is empty.
Is this problem with this bundle or have I done something wrong?

What is /fc_load_events?

I'd like to use your package, but this appears to rely on a file that lives at /fc_load_events in your examples. You never specify what file this refers to. It seems like it would point to the file you list as your Listener, but of course a Listener does not live at a URL from the web. It's also not clear to me when the Listener is supposed to be summoned. Can you help clarify these points?

Add documentation for AssetMapper installation

The documentation describes installing the bundle with WebpackEncore, we should also document how to install with AssetMapper, which is now the Symfony preferred way.

Of course, we can't do that until the jsDeliver issue is fixed.

Event filter with checkboxes

Hello everyone,

So, I download the tattali/calendar-bundle, I created all of my entities and now I would like to create an event filter for each section. Basically, an event is linked to a section and i would like to add some checkboxes that will be the different sections that exists and when I click on one checkbox, the only events that will be shown on the calendar will be the events from the section of this checkbox.
I already check online to see if someone have the same issue than me but I do not understand verry well how the filters worked because I'm a beginner.

If someone could help me !!!!
Thank yoouuuu

Comment éviter doublons de réservation et heure de fin< heure de début

Bonjour Tattali,

Je vous contacte car je souhaiterais savoir :

  1. comment paramétrer le calendrier pour éviter un doublon de réservation : ex : si le créneau 24/08 16h 16h15 est déjà pris, comment bloquer toute nouvelle réservation sur ledit créneau en affichant un message "veuillez modifier votre créneau" ?

  2. j'ai constaté qu'on pouvait définir une heure de fin < heure de début d'un événement : est-ce un bug ? Comment empêcher que cela se produise ?

Merci.

"No route found for "POST /fc-load-events"

Bonjour ,en suivant le tutoriel associé a ce bundle j'ai réalisé tout les taches demandés ,or fc-load-event me donne 404 le navigateur ne peut pas savoir cette route Merci de me renseignier sur ce probléme

Data not available other month

Hey,

When I create a new event at the end of the month my event is not available on next month.

Ex: If I create an event on the 29 septembre to 4 October, I saw it in the September, if I swap to October I didn't see the event on the 1,2,3,4 October.

Any idea ?

Regards,

Demo now available. Thoughts on making this a Symfony UX componenent?

Hi, tattali, great bundle!

I put together a demo using the CRUD example (Booking.php), wrapped it in a bootstrap admin theme, and it's available now at

https://calendar-bundle-demo.herokuapp.com/

The source code is at https://github.com/tacman/calendar-bundle-demo.git.

A natural next step of a demo would be to be able to add/edit events by clicking on the calendar itself. I've recently been using Stimulus for most of my javascript needs, and this seems like a perfect fit.

Even better that writing a Stimulus controller for the demo would be to include it in the bundle, so that it would work like the UX components on https://symfony.com/doc/current/frontend/ux.html#ux-packages-list.

Is this something you'd be interested in doing?

probleme

Bonjour j'ai installée votre bunddle sous symfony 5.0. Après avoir suivi toute les instructions de base, j'ai toujours une erreur 500 quand j'envoie la requête ajax.
Voici le la dénomination de l'erreur dans le profiler de Symfony:
'The controller for URI "/fc-load-events" is not callable. Controller "CalendarBundle:Calendar:load" does neither exist as service nor as class'. Malgré les recherches et les tentaives je suis à cours de solution. Merci de m'indiquer a marche a suivre pour résoudre le problême.

Handle request from select box

Hi there
First thanks for this bundle.I want to create front-end drop down filter,but i have a problem with form request.

Argument 2 passed to App\EventSubscriber\CalendarSubscriber::onCalendarSetData() must be an instance of Symfony\Component\HttpFoundation\Request, string given, called in /var/www/html/faa/vendor/symfony/event-dispatcher/Debug/WrappedListener.php on line 126

not sure where to handle request to make response with filtered events

thanks

My data arent displayed

Hey,
However, I followed the documentation carefully but nothing helped. The calendar is displayed, but not the data inside. Can you help me please ?
Cordially
Alexandra

Events not showing

Hi,
I tried to use this in my project (Symfony 6), and the Events aren't showing, there is just the calendar. I used the code that was given here, and made different attempts with differents datetimes, without any result. I got a bunch of errors, and I don't know from where they're coming, so if someone has an idea, thanks by advance.
image

Twig Component and Stimulus

One of the goals of this bundle could be to be able to customize fullcalendar without ever writing javascript. That is, to replace the section https://github.com/tattali/CalendarBundle#basic-functionalities with some twig calls.

Stimulus is the obvious choice, and could be wrapped in a twig component to make it even easier.

Brainstorming about the format.

{# events is an array of events, event contains at a minimum keys of title and start) #}
<div {{ stimulus_controller('calendar', {
        events: events
    })) }}>
</div>

OR

<twig:Calendar :events="events" />

Both of these work in the demo app at https://github.com/tacman/micro-calendar

image

Obviously, we'll want to move the twig component and stimulus controller to the bundle, but it's considerably easier to work in the demo app first. But when that happens, the developer simply needs to create events, e.g.

        $dt = new \DateTime(); // for the demo, start with the current date
        $events = [];
        $events[] = ['title' => 'now()', 'start' => $dt->format('c')];
        $events[] = ['title' => 'Set Goals', 'start' => $dt->format("Y-m-01")];
        $events[] = ['title' => 'Reflect', 'start' => $dt->format("Y-m-t")];

And pass them to the twig template, and in twig, call the component. ZERO JAVASCRIPT from the developer! Even what libraries to load will be hidden, since the bundle auto-registers everything, as long as the base loads the assets:

        {% block javascripts %}
            {{ importmap() }}
        {% endblock %}

So before moving the stimulus controller and twig component to the bundle, what are the options we want to expose via attributes? Obviously events and initialView, which for my application was actually enough to be usable. But fullcalendar has TONS of options, I imagine we'll start with the easy ones. I'm working on the icalendar plugin first.

Unable to generate a URL for the named route "fc_load_events" as such route does not exist.

Symfony 4.4.20

Boys, I have the same issue. Bundle is enabled, Services are registered.

An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "fc_load_events" as such route does not exist.").

Composer:

"scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },

Also I notice when I install the bundle, recipe does not register bundle automatically, I had to manually register this bundle.

Please let me know if you want me to open a new issue or you ok with this. I thought if all comments are at one place then it would be easier for others to find.

bin/console debug:router fc-load-events
The route "fc-load-events" does not exist.

Not all events are displayed

Good morning everyone,
First of all, excuse my broken English.
Here I followed the documentation of the excellent bundle that is fullcalendar. However I have a problem.
I have two sources of data (events) that feed the calendar. But I have only the last of the two sources (entity) which is displayed. This makes me 2 events instead of 10.
Do you have an idea on the origin of this concern.
Thank you

Vincent

composer require tattali/calendar-bundle (AdminThemeBundle)

Hello,

Impossible for me to fetch the bundle, when I do composer require tattali/calendar-bundle, I get the following error:

Your GitHub credentials are required to fetch private repository metadata (https://github.com/kevinpapst/AdminThemeBundle)
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+deckgenius-web+2019-07-01+0703
to retrieve a token. It will be stored in "/home/bkopp/.config/composer/auth.json" for future use by Composer.

AdminThemeBundle migrated to AdminLTEBundle ?

Thanks in advance.

Display icon in title

Hi,

Can I render a raw HTML tag inside an event title? I need to show a "classic" <i class="fa fa-comment"/> icon before the event title.

Thanks.

Performance issue in CalendatEvent class

Hi,

After profiling my code, I found a performance issue in this function :

    public function addEvent(Event $event): self
    {
        if (!\in_array($event, $this->events, true)) {
            $this->events[] = $event;
        }
        return $this;
    }

Indeed, the performance of in_array() php function is horrible. Can you provide another function using isset() or even with no verification of duplicates ?

You can see in the Symfony Profiler, 1500ms to load 27 000 events without the check in addEvent() function VS 3100ms...

without_check
with_inarray
,
Thanks,

Showing with condition

Hi,
I'm using your bundle with Doctrine ORM.
It's working. But I want to display two calendar.
In my entity Booking, I've a boolean "Public". I would like to display the first calendar with my boolean at 1 and the second one at 0.
Someone can help me please ?

Impossible de mettre à jour le bundle

Bonjour,

Dans mon composer.json j'ai actuellement dans mes require :

"tattali/calendar-bundle": "^1.1",

J'ai vu qu'il y avait une version 1.2.
J'ai modifié mon require pour

"tattali/calendar-bundle": "^1.2",

et tenté un update, mais à chaque fois, j'obtiens "tattali/calendar-bundle": "^1.1",

Filters getting

Hello,

I use Symfony 4..2.1.

I meet a problem when I try to get the filters. I implement the filter variable in the javascript like this :
` eventSources: [
{

                            url: "/fc-load-events",
                            type: "POST",
                            data: {

                                    filters: {"vehicle": 1},

                                },
                            error: () => {

                                            alert("There was an error while fetching FullCalendar!");

                                         },

                        },
                      ],`

In my listener, I get the filters with $filters = $calendar->getFilters();. When I try to get the specific filter with $vehicle = $filters['vehicle'];, I have this error :

"Notice: Undefined index: vehicle"

Symfony 5.4 - Events no display on calendar

Hey, I'm a very new user of Symfony version 5.4.
During postgraduate studies, we are doing a project of a board game rental. I want to add a calendar to display the current rentals.
I started testing the solution: https://github.com/tattali/CalendarBundle/blob/master/src/Resources/doc/doctrine-crud.md
I did what was in the description and the events do not show up; /
The symfony debugger shows AJAX requests with code 200 with an empty response.
I changed in the template eventSource to the add a normal entry of events , they appeared in the calendar.
Is there anyone able to point out what else to pay attention to?
We use Symfony version 5.4 and the EasyAdmin 4 plugin.

Documentation request: make note of security / firewall regarding the fc-load-events URL

Perhaps this is a none issue, but for me it was surprising the documentation did not mention it. If you have a Symphony app with a firewall or login/security system going on, which is quite common I suppose, the requested URL fc-load-events should be cleared of access. Perhaps it is good to mention this in the documentation?
Or close it if I did something wrong.

Anyway thanks for your work !!

"There was an error while fetching FullCalendar!"

I had already installed FullCalendar on an old symfony project and everything was working fine.
I did the same installation in a new project but I have the error: "There was an error while fetching FullCalendar!"
The only difference is the version of symfony 5.1.

Referencing controllers with CalendarBundle:Calendar:load is deprecated

Using symfony 4.2, I am seeing this warning in the profiler:

Referencing controllers with CalendarBundle:Calendar:load is deprecated since Symfony 4.1, use "CalendarBundle\Controller\CalendarController::loadAction" instead.

This appears to be coming from your file src/Resources/config/routing.yaml. A minor thing to be sure, but worth mentioning.

Navigation Button not straight

Hi , I saw an issue in the css of the buttons in your navbar of the calendar.

They are not straight !!
image

there is two pixels more on the left button than the right one
image
image

it seems to be an error with the css align items not working properly

i thinks you can just delete align items from the fc-toolbar class
image
image

and add display flex to the today button to have a straight navbar
image

I cant figure out how to give to the left buttons the 2,4px to have a straight navbar but I'm sure you while find how to fix it


{% block stylesheets %}
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.min.css">
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.min.css">
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.min.css">
	<link rel="stylesheet" href="{{ asset('styles/app.css') }}">
	<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
{% endblock %}

{% block javascripts %} <script src="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.min.js"></script>
	 <script src="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.min.js"></script>
	 <script src="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.min.js"></script>
	 <script src="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.min.js"></script>
	 <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
	 <script type="text/javascript">
																																																				    document.addEventListener('DOMContentLoaded', () => {
																																																					var calendarEl = document.getElementById('calendar-holder');
																																																					var calendar = new FullCalendar.Calendar(calendarEl, {
																																																				        defaultView: 'timeGridWeek',
																																																						editable: true,
																																																						expandRows: true,
																																																						height: 'auto',
																																																						eventSources: [
																																																						    {			
																																																				                url: "{{ path('fc_load_events') }}",
																																																							    method: "POST",
																																																					            extraParams: {
																																																							        filters: JSON.stringify({})
																																																								},                   
																																																				                failure: () => {				        
																																																				                    // alert("There was an error while fetching FullCalendar!");
																																																				                },
																																																					        },
																																																					    ],
																																								    													header: {
																																																						    left: 'prev,next today',
																																																							center: 'title',
																																																							right: 'dayGridMonth,timeGridWeek,timeGridDay',
																																																					    },
																																																						plugins: [ 'interaction', 'dayGrid', 'timeGrid' ], // https://fullcalendar.io/docs/plugin-index
																																																						timeZone: 'UTC',
																																																						minTime: '07:30:00',
																																																						maxTime: '20:00:00',
																																																						weekends: false,
																																																						editable: false,
																																																						locale: 'fr'
																																																						});
																																																					calendar.render();
																																																					});
																																																																										
																																																				</script>
{% endblock %}

{% block title %}
	Accueil
{% endblock %}

{% block body %}
	<div class="content">
		<div class="calendar">
			<div id="calendar-holder"></div>
		</div>
		<div class="BI">
			<div id="carouselExampleIndicators" class="carousel slide">
				<div class="carousel-inner">
					{% for BI in BIS %}
						{% if loop.first %}
							<div class="carousel-item active">
								<div class="bi">
									<img src="{{ BI.path }}" alt="{{ BI.title }}">
									<h2>{{ BI.title }}</h2>
									<div class="bi-title-underline"></div>
									<p>{{ BI.description }}</p>
								</div>
							</div>

						{% else %}
							<div class="carousel-item">
								<div class="bi">
									<img src="{{ BI.path }}" alt="{{ BI.title }}">
									<h2>{{ BI.title }}</h2>
									<div class="bi-title-underline"></div>
									<div class="bi-description">
										<p>{{ BI.description }}</p>
									</div>
								</div>
							</div>
						{% endif %}
					{% endfor %}

					<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="prev">
						<span class="carousel-control-prev-icon" aria-hidden="true"></span>
						<span class="visually-hidden">Previous</span>
					</button>
					<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="next">
						<span class="carousel-control-next-icon" aria-hidden="true"></span>
						<span class="visually-hidden">Next</span>
					</button>
				</div>
			</div>
		</div>
	{% endblock %}

here is my twig and css

body{
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("/cir_0668.jpg");
    background-size: cover;
    background-position: center;
    font-family: 'DM Sans';
   
}


.content {
    
    display: flex;
    justify-content: space-between;
    height: 100%;
    margin-bottom: 20px;

}
.calendar{
    
    margin: 60px 40px 0px 40px;
    border-radius: 5px;
    background-color: white;
    width: 60%;
}
#calendar-holder {
 /* smaller page size is 660px deal with it */
    
   
}

.BI {
    margin : 60px 40px 0px 40px;
    flex-grow: 1;
    max-width: 38%;
    background-color: white;
    border-radius: 5px;
}

.bi h2{
    margin-top: 5px;
}

.bi p {
    overflow-y: auto;
    max-height: fit-content;
}
.bi-title-underline {
    width: 40%;
    height: 2px;
    
    background-color: black;
}

.bi img {
    width: 700px;
    height: 200px;
    object-fit: cover;
}

.bi {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 20px;
    font-family: 'DM Sans';
}

Evènement "eventAfterAllRender" ne fonctionne pas

Salut Théo !

Je sais pas si ça vient de ton bundle, mais lorsque j'essaie de mettre l'évènement eventAfterAllRender, il est ignoré.

https://fullcalendar.io/docs/v3/eventAfterAllRender

Dans le template lorsque je configure FullCalendar, j'essaie de mettre l'event :

eventAfterAllRender: function(view) { console.log("test"); },
Mais aucune sortie

Tandis que sur une version sans ton bundle, l'event fonctionne : http://jsfiddle.net/matthias_h/tsbLby4e/

Est-ce que ça vient de ton bundle ?

Symfony 6.3 Deprecations

Method "Symfony\Component\DependencyInjection\Extension\ExtensionInterface::load()" might add "void" as a native return type declaration in the future. Do the same in implementation "CalendarBundle\DependencyInjection\CalendarExtension" now to avoid errors or add an explicit @return annotation to suppress this message.

It is already fixed https://github.com/tattali/CalendarBundle/blob/master/src/DependencyInjection/CalendarExtension.php#L22

@tattali
Maybe you can have some time to look at the open PRs and tag a new version?

What about the other events?

Hi,

Nice work, but lot more work has to be done, I presume.
With the actual work, it is impossible to let symfony know about creation, edition and delete events. They have to be generated "your own way" in ajax and creating actions in the controllers to make it work. Which is the real purpose of your symfony bundle if it doen't do "the real work"? I mean, if you can only load the contents from the database to the calendar with your bundle, why not doing it "the dirty way" for everything and also bypassing fc-load-events and directly calling controller's CRUD actions from fullcalendar?

I think that the rest of the events should be created in your bundle and attended as services to make everything work as expected. If not, using your bundle won't help so much. Let me know if I can help on this.

DateTime::__construct() expects parameter 1 to be string, null given

Moving from the old bundle and getting this error:

[2019-03-31 21:06:44] php.CRITICAL: DateTime::__construct() expects parameter 1 to be string, null given {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): DateTime::__construct() expects parameter 1 to be string, null given at /vendor/tattali/calendar-bundle/src/Controller/CalendarController.php:37)"} []
[2019-03-31 21:06:44] request.CRITICAL: Uncaught PHP Exception TypeError: "DateTime::__construct() expects parameter 1 to be string, null given" at /vendor/tattali/calendar-bundle/src/Controller/CalendarController.php line 37 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): DateTime::__construct() expects parameter 1 to be string, null given at /vendor/tattali/calendar-bundle/src/Controller/CalendarController.php:37)"} []

fc_load_events

Hello !
I'm using your bundle in a Symfony project, but in the back end part (with easy admin). When I was using it in the front, it was working perfectly, but now I think there is a problem to load the events as the script JS is calling the path 'fc_load_events", do you have an idea to fix this ? The calendar is displayed but not the events.
thank you by advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.