<% for month in 1..12 %>
<%= Date::MONTHNAMES[month] %>
<% for day_name in 0..6 %>
<%= Date::DAYNAMES[day_name][0..1] %>
<% end %>
<% month_start = Date.new(years[:current], month) %>
<% month_end = ((month_start>>1)-1) %>
<% month_start_print = month_start - month_start.wday %>
<% month_end_print = (month_end + 6) - (month_end.wday) %>
<% (month_start_print).upto(month_end_print) do |d| %>
<% day_is_in_current_month = d.month == month ? true : false %>
<%= "adjacent_month" if d.month != month %> <%= "cal-#{d.strftime("%Y-%m-%d")}" %>">
<% issue = issues.select {|issue| Date.parse(issue["publication_date_dtsi"]) == d }.first %>
<% if issue && day_is_in_current_month %>
<%= link_to d.day, main_app.hyrax_newspaper_issue_path(issue) %>
<% else %>
<%= d.day %>
<% end %>
<% if d.wday == 6 %>
<% end %>
<% end %>
<% if month % 4 == 0 %>
<% end %>
<% if month % 3 == 0 %>
<% end %>
<% if month % 2 == 0 %>
<% end %>
<% end %>