saade / filament-fullcalendar

The Most Popular JavaScript Calendar as a Filament Widget
MIT License
269 stars 83 forks source link

Strange bug, while returning array of EventData #133

Open GeoSot opened 9 months ago

GeoSot commented 9 months ago

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

tgeorgel commented 9 months ago

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

vasiliyaltunin commented 6 months ago

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;