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

Multi-day Events #35

Closed
spib opened this issue Jun 3, 2014 · 2 comments
Closed

Multi-day Events #35

spib opened this issue Jun 3, 2014 · 2 comments

Comments

@spib
Copy link

spib commented Jun 3, 2014

Hi,

How do you show multi-day events on a calendar? The following piece of code correctly shows events which start on a particular date, but it doesn't show events which span multiple days. I'm using the Indexed Event Collection.

<?php foreach ($eventCollection->find($day) as $event): ?>
    <li><?= $event ?></li>
<?php endforeach ?>

Thanks

@GDmac
Copy link

GDmac commented Feb 1, 2016

Take a look at the find() method of the indexed collection and of basic collection. Indexed Collection only stores and finds events in an array with keys derived from eventBegin. The basic collection actually has some logic in its find() method to lookup period->containsEvent() or event->contains(date) etc.

So, your $eventCollection->find($day) only finds events under its array this->events[$day].

  1. How are you creating/retrieving your collection?
  2. You can supply your provider to Calendar and getEvents() to retrieve a basic collection
  3. Or you can retrieve an array from your own provider
$collection = $calendar->getEvents($period);
// or
$array = $provider->getEvents($DateTimeStart, $DateTimeEnd);

@spib
Copy link
Author

spib commented Feb 1, 2016

Thanks, this is an old issue and I'm no longer using this module so the issue can be closed

@spib spib closed this as completed Feb 1, 2016
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

2 participants