Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange bug, while returning array of EventData #133

Open
GeoSot opened this issue Nov 28, 2023 · 2 comments
Open

Strange bug, while returning array of EventData #133

GeoSot opened this issue Nov 28, 2023 · 2 comments

Comments

@GeoSot
Copy link

GeoSot commented Nov 28, 2023

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
Copy link

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

@vasiliyaltunin
Copy link

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants