Sha256: 9b0c1073fb03e846ec151add0231d3ef11f3d7f552f87aa39634dbd1b3254b17

Contents?: true

Size: 895 Bytes

Versions: 14

Compression:

Stored size: 895 Bytes

Contents

- dates = @event.upcoming_public_shows.collect(&:datetime_local_to_event).reject {|d| d < Time.zone.now }.map {|d| d.to_date}
- dates_by_month = dates.group_by {|d| d.strftime("%B %Y")}

-dates_by_month.each do |month, dates|
  .calendar-month
    %h3
      = month
    %table.calendar{:align => "center"}
      - (dates.first.beginning_of_month.to_date..dates.first.end_of_month.to_date).each do |date|
        = "<tr>".html_safe if date == dates.first.beginning_of_month.to_date || date.wday == 0
        = Array.new(date.wday, "<td class='filler'></td>").join('').html_safe if date == dates.first.beginning_of_month.to_date && dates.first.beginning_of_month.to_date.wday != 0

        = "<td class='#{dates.include?(date) ? "has_show" : ""}' data-date='#{date.strftime('%D')}'>#{date.strftime('%e')}</td>".html_safe
        = "</tr>".html_safe if date.cwday == 6

%div{:style => 'clear:both'}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
artfully_ose-1.2.0.pre.15 app/views/store/events/_calendar.html.haml
artfully_ose-1.2.0.pre.12 app/views/store/events/_calendar.html.haml
artfully_ose-1.2.0.pre.11 app/views/store/events/_calendar.html.haml
artfully_ose-1.2.0.pre.10 app/views/store/events/_calendar.html.haml
artfully_ose-1.2.0.pre.9 app/views/store/events/_calendar.html.haml
artfully_ose-1.2.0.pre.8 app/views/store/events/_calendar.html.haml
artfully_ose-1.2.0.pre.7 app/views/store/events/_calendar.html.haml
artfully_ose-1.2.0.pre.6 app/views/store/events/_calendar.html.haml
artfully_ose-1.2.0.pre.5 app/views/store/events/_calendar.html.haml
artfully_ose-1.2.0.pre.4 app/views/store/events/_calendar.html.haml
artfully_ose-1.2.0.pre.3 app/views/store/events/_calendar.html.haml
artfully_ose-1.2.0.pre.2 app/views/store/events/_calendar.html.haml
artfully_ose-1.2.0.pre.1 app/views/store/events/_calendar.html.haml
artfully_ose-1.2.0.pre app/views/store/events/_calendar.html.haml