Blog

Fullcalendar integration using JQUERY, MySQL & PHP with repeating events support

Fullcalendar integration using JQUERY, MySQL & PHP with repeating events support
21 Jul 2018 | PHP | 3

Fullcalendar integration using JQUERY, MySQL & PHP with repeating events support

Recently, I was working on a project that required populating events from a MySQL database to a Fullcalendar using PHP and JQuery.
The repeating events were set to repeat on a given frequency such as every (n) days/weeks/months/years. The client also needed a calendar that allowed completing single task in a repeating range. The following is my raw hack at tackling this problem. Any more efficient suggestions are welcome.

This solution is implemented using Laravel framework.

laravel new events-app

Migration files

php artisan make:migration CreateEventsTable --create=events

- Edit the migration file

Schema::create('events', function (Blueprint $table) {
$table->increments('id');
$table->string('title',100);
$table->integer('repeats')->nullable()->default(0);
$table->integer('freq')->nullable();
$table->string('freq_term')->nullable();
$table->date('start_date')->nullable();
$table->date('end_date')->nullable();
$table->string('status')->default('open'); //open, in-progress, closed, cancelled
$table->text('notes')->nullable();
$table->timestamps();
});

Fullcalendar has a dow function that allows to repeat on specific days of the week. The problem is when the event is set on a date range, when you use `dow`, then the event repeats forever in both past and future. Fullcalendar's end date is now exclusive and therefore I had to add 1 to the `for` loop the loops through the date range.

Update:

https://github.com/jgmuchiri/fullcalendar-php-mysql-repeating-events


RoboForm: Learn more...

Discussion

Hi there, I enjoy reading through your article. I like to write a little comment to support you.
rapid tone efectos secundarios | 23 Oct 2018

Thanks for your marvelous posting! I definitely enjoyed reading it, you happen to be a great author. I will always bookmark your blog and definitely will come back down the road. I want to encourage yourself to continue your great job, have a nice evening!
rapid tone ultra reviews | 23 Oct 2018

This paragraph will assist the internet users for creating new weblog or even a weblog from start to end.
rapid tone cost per bottle | 23 Oct 2018