<%= link_to "Previous", url_for(params.merge(start_date: date_range.first - 1.day)) %> Week <%= start_date.strftime("%U").to_i %> <%= link_to "Next", url_for(params.merge(start_date: date_range.last + 1.day)) %> <% date_range.slice(0, 7).each do |day| %> <% end %> <% date_range.each_slice(7) do |week| %> <% week.each do |day| %> <%= content_tag :td, class: calendar.td_classes_for(day) do %> <% if defined?(Haml) && block_is_haml?(block) %> <% capture_haml do %> <% block.call day, sorted_events.fetch(day, []) %> <% end %> <% else %> <% block.call day, sorted_events.fetch(day, []) %> <% end %> <% end %> <% end %> <% end %>
<%= I18n.t("date.abbr_day_names")[day.wday] %>