filament-fullcalendar icon indicating copy to clipboard operation
filament-fullcalendar copied to clipboard

Strange bug, while returning array of EventData

Open GeoSot opened this issue 7 months ago • 1 comments

Hello @saade

Firstly, I would like to thank you for this package, as it is a very handy helper tool

I tried to use it, according to the documentation and fell into the following issues.

While I am returning, an array of EventData objects, like below, calendars appears empty image

However, it can be easily fixed, if I just transform each EventData to array image

At this point, I am getting results.

But again I faced another issue.

In order these events to have the proper time, I need to translate it first at localString (I have tried of course to enforce timezone to calendar plugin, but no result) image

I don't mind, a lot, as I got to a workaround, but seemed fair to report these minor issues

Thank you for your time here

GeoSot avatar Nov 28 '23 22:11 GeoSot

Hey, same for me, I need to turn EventData's to arrays to be able to view my events on the calendar.

tgeorgel avatar Dec 13 '23 09:12 tgeorgel

For me this works

        $data = Day::query()
        ->where('ddate', '>=', $fetchInfo['start'])
        ->where('ddate', '<=', $fetchInfo['end'])
        ->get()
        ->map(
            fn (Day $event) => EventData::make()
                ->id($event->id)
                ->title($event->name)
                ->start($event->ddate)
                ->end($event->ddate)
                    ->url(
                    url: DayResource::getUrl(name: 'edit', parameters: ['record' => $event]),
                    shouldOpenUrlInNewTab: true
                )
                
        )->toArray();
        return $data;

vasiliyaltunin avatar Feb 25 '24 09:02 vasiliyaltunin