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

Ability to add an event occurring in multiples dates? #39

Open
rapgithub opened this issue Sep 1, 2022 · 4 comments
Open

Ability to add an event occurring in multiples dates? #39

rapgithub opened this issue Sep 1, 2022 · 4 comments

Comments

@rapgithub
Copy link

how to add the ability to add same event in multiples days selecting a range of dates for an event?
it there a sample for this?
thanks

@rapgithub
Copy link
Author

rapgithub commented Sep 8, 2022

anyone considering this use so in the calendar it shows the event occurring in multiple days from start to end dates?

@rapgithub
Copy link
Author

sadly no reply from anyone! package is not live active I think... sadly!

@yinaojeda
Copy link

Hello @rapgithub!
Did you find what you were looking for in another package?
I'm looking for the same thing, and I also need to be able to create or generate a yearly view from the calendar...

@lrljoe
Copy link

lrljoe commented Nov 14, 2022

You'll need to pass two fields into the collection, start_date, and end_date.

Then modify the LivewireCalendar.php file and replace getEventsForDay

    public function getEventsForDay($day, Collection $events) : Collection
    {
        return $events
            ->filter(function ($event) use ($day) {
                return Carbon::parse($day)->between($event['start_date'],$event['end_date']);
            });
    }

Do note that this will assume that the start time is the original start time. So you may want to put some logic in to take that into account

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