Created
October 17, 2013 06:40
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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