<script>

$(document).ready(function() {

	$('#calendar').fullCalendar({
		header: {
			left: 'prev,next today',
			center: 'title',
			right: 'month,agendaWeek,agendaDay'
		},      
                      events : [

                      <% @resource.events.each do |event| %>
                      {
                        title : '<%= event[:title] %>', 
                        start : '<%= event[:start].strftime("%F %H:%M:%S") %>',
                        end : '<%= event[:end].strftime("%F %H:%M:%S") %>',
                        allDay: <%= event[:allday].to_s %>
                      },
                      <% end %>
                      ],
    timeFormat: ''
		
	});
	
});

</script>

<h2><%= @resource.name %></h2>

<p><%= @resource.description %></p>

<div id="feeds">
  <%= link_to('ICAL', resource_path(@resource, :format => :ics), {:class => 'label label-ical'}) %>
  <%= link_to('JSON', resource_path(@resource, :format => :json), {:class => 'label label-json'}) %>
</div>

<div id='loading' style='display:none'>loading...</div>
<div id='calendar'></div>
<script>

$(document).ready(function() {

	$('#calendar').fullCalendar({
		header: {
			left: 'prev,next today',
			center: 'title',
			right: 'month,agendaWeek,agendaDay'
		},      
                      events : [

                      <% @resource.events.each do |event| %>
                      {
                        title : '<%= event[:title] %>', 
                        start : '<%= event[:start].strftime("%F %H:%M:%S") %>',
                        end : '<%= event[:end].strftime("%F %H:%M:%S") %>',
                        allDay: <%= event[:allday].to_s %>,
                        className : '<%= event[:start].strftime("Date%Y%m%d%H%M%S") %>'
                      },
                      <% end %>
                      ],
    timeFormat: ''
		
	});
	
});

</script>

<h2><%= @resource.name %></h2>

<p><%= @resource.description %></p>

<div id="feeds">
  <%= link_to('ICAL', resource_path(@resource, :format => :ics), {:class => 'label label-ical'}) %>
  <%= link_to('JSON', resource_path(@resource, :format => :json), {:class => 'label label-json'}) %>
</div>

<div id='loading' style='display:none'>loading...</div>
<div id='calendar'></div>
Add class name to events in frontend
Add class name to events in frontend

Makes it easier to test that the events are where we expect them to be
