Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sarath-c-sandwich/7020071 to your computer and use it in GitHub Desktop.
Save sarath-c-sandwich/7020071 to your computer and use it in GitHub Desktop.
Integration and loading public holiday from Google Calendar into Fullcalendar rails4
1. Add rails4 Fullcalendar gem to Gemfile
gem 'fullcalendar-rails'
Then run command: bundle install
2. Copy & pasted into assets/stylesheet/application.css.scss (By default application.css, so just rename)
*= require fullcalendar
3. Copy & pasted into assets/javascript/application.js
//= require fullcalendar
//= require gcal
4. then create a new view and put a tag
%div#fullcalendar
5. Put this script into the same view
:javascript
// defined instance of the dialog
$( "#dialog" ).dialog( {
autoOpen: false,
title: "Input Holiday"
});
// user click, then dialog popup
$('#calendar').fullCalendar({
header: {
right: "prev,next, today",
center: "title",
left: "month,agendaWeek,agendaDay"
},
events: {
url: 'https://www.google.com/calendar/feeds/en.cambodian%23holiday%40group.v.calendar.google.com/public/basic'
},
eventSources: [{
url: "/posts",
}],
dayClick: function() {
$('#dialog').dialog("open");
},
theme: true,
height: 600,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment