<% bow = (Time.now - 6.days).beginning_of_week %> <%= render :partial => 'events/calendar_month', :locals => { :position => :top, :date => bow.to_date } %> <% 28.times do |i| %> <% day = bow + i.days %> <%= raw cycle(*(Array.wrap("") + 6.times.map{""}) + Array.wrap(:name => "tr_start")) %> <%= raw cycle(*(6.times.map{""} + Array.wrap('') + Array.wrap(:name => "tr_end"))) %> <% end %> <%= javascript_tag do %> $(function(){ SocialStream.Calendar.init({ eventsPath: "<%= escape_javascript polymorphic_path([@current_subject, Event.new]) %>", start: "<%= bow.to_i %>", end: "<%= (bow + 28.days).to_i %>" }); }); <% end %> <%= render :partial => 'events/calendar_month', :locals => { :position => :bottom, :date => (bow + 28.days).to_date } %>