Sha256: 0190693a53ca9b8b5d1c150e78ced4b7d5a40ce7919b40d9e4577aab2d70775a

Contents?: true

Size: 972 Bytes

Versions: 5

Compression:

Stored size: 972 Bytes

Contents

- date = params[:start_date].presence.try(:to_date) || Date.current

.effective__simple-calendar
  .calendar-heading.d-flex.justify-content-between.align-items-center
    .calendar-arrow
      = link_to t('simple_calendar.previous', default: 'Previous').html_safe, effective_events.events_path(start_date: date - 1.month)

    %span.calendar-title
      = t('date.month_names')[start_date.month]

    .calendar-arrow
      = link_to t('simple_calendar.next', default: 'Next').html_safe, effective_events.events_path(start_date: date + 1.month)

  %table.table.table-sm
    %thead
      %tr
        - date_range.slice(0, 7).each do |day|
          %th= t('date.abbr_day_names')[day.wday]

    %tbody
      - date_range.each_slice(7) do |week|
        %tr
          - week.each do |day|
            - content = capture_haml(day, sorted_events.fetch(day, []), &passed_block)
            = content_tag :td, class: content.to_i > 0 && 'calendar-day' do
              = day.day

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
effective_events-0.6.12 app/views/simple_calendar/_month_calendar.html.haml
effective_events-0.6.11 app/views/simple_calendar/_month_calendar.html.haml
effective_events-0.6.10 app/views/simple_calendar/_month_calendar.html.haml
effective_events-0.6.9 app/views/simple_calendar/_month_calendar.html.haml
effective_events-0.6.8 app/views/simple_calendar/_month_calendar.html.haml