Fullcalendar Ruby Gem
This gem is a fork of fullcalendar updating it to last version of FullCalendar (4.2)
This gem just includes fullcalendar and scheduler as an asset in rails applications or other ruby frameworks Fullcaledar-scheduler is not free for commercial use, so make sure you have a valid license to use scheduler.
Installation
Fullcalendar JavaScript depends on jQuery and moment js. If you're using Rails 5.1+, add the jquery-rails gem to your Gemfile:
gem 'jquery-rails'
gem 'momentjs-rails'
Add this line to your application's Gemfile:
gem 'full_calendar'
And then execute:
$ bundle
Or install it yourself as:
$ gem install full_calendar
Install generator
command
rails g fullcalendar:install
this generator will:
-
- append
//= require calendar
addapp/assets/javascripts/application.js
- append
-
- append
*= require calendar
addapp/assets/stylesheets/application.css
- append
-
- create calendar.js in
app/assets/javascripts/
- create calendar.js in
-
- create calendar.scss in
app/assets/stylesheets/
- create calendar.scss in
Manual install
JavaScripts
Include the JavaScript in your app/assets/javascripts/application.js
:
//= require jquery
//= require calendar
create new file app/assets/javascripts/calendar.js
//Core component
//= require fullcalendar
// optional locale
//= require fullcalendar/locale/ms
//Optional addon scheduler
//= require fullcalendar/scheduler
Stylesheets
Include the stylesheet in your app/assets/stylesheets/application.css
:
*= require calendar
or if you using scss
Include the stylesheet in your app/assets/stylesheets/application.scss
:
@import 'calendar';
Create new file app/assets/stylesheets/calendar.scss
@import 'fullcalendar';
Initialization
Where needed in your JavaScripts, initialize your fullcalendar:
$(document).ready(function() {
var calendarEl = document.getElementById('calendar');
new (FullCalendar.Calendar)(calendarEl);
});
Usage
see fullcalendar documentations here
The gem is available as open source under the terms of the MIT License. Fullcalendar and Scheduler, which makes up the majority of this gem, has its own, separate licensing agreement.
- Fullcalendar Read license
- Scheduler Read license