laravel-fullcalendar icon indicating copy to clipboard operation
laravel-fullcalendar copied to clipboard

Support for recurrent events (solution)

Open guillermobt opened this issue 8 years ago • 4 comments
trafficstars

I've been having trouble when working with recurring events because in the "agenda" views, they were not showing up scheduled in the proper start time.

I managed to solve it adding the following code in the EventCollection.php class, after the $eventArray definition:

/* On recurring events, fullcalendar requires the start and end values to just contain the time (hour:minutes) part of the date */

if ($vOptions = $event->getEventOptions())  {
	if (isset($vOptions ['ranges']) || isset($vOptions ['dow'])) {
		$eventArray['start'] = $event->getStart()->format('H:i');
		$eventArray['end'] = $event->getEnd()->format('H:i');
	}
}

guillermobt avatar Jun 08 '17 08:06 guillermobt

@maddhatter : Please, consider merging pull-request #83 in order to fix this bug.

I attached some screenshots in the pull-request comments so you can see what I'm talking about.

guillermobt avatar Nov 30 '17 12:11 guillermobt

Hi, Sorry for reactivating an old thread, but I'm looking to integrate recurring events too. I can't see daysOfWeek option in this bundle.

I need to create events based on courses created in database with: _ day of week (number -> 1 for Monday) _ start hour _ start minute _ duration

All events should repeat weekly.

I found a workaround by setting a static start date and adding weeks with a foreach loop, but that solution is ugly and will bring issues on year change.

I can see your commit has not been merged. How come ? Any idea on how I could get my job done please ?

ShapesGraphicStudio avatar Sep 23 '19 15:09 ShapesGraphicStudio

Hi again,

I was looking for daysOfWeek, but as it uses FullCalendar V2, I had to take a look at dow in the options array.

Thanks to your great commit, it works fine now !

ShapesGraphicStudio avatar Sep 23 '19 16:09 ShapesGraphicStudio