filament-fullcalendar
filament-fullcalendar copied to clipboard
Strange bug, while returning array of EventData
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
However, it can be easily fixed, if I just transform each EventData to array
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)
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
Hey, same for me, I need to turn EventData's to arrays to be able to view my events on the calendar.
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;