Module: StimulusPlumbers::Helpers::CalendarHelper

Included in:
StimulusPlumbers::Helpers
Defined in:
lib/stimulus_plumbers/helpers/calendar_helper.rb

Instance Method Summary collapse

Instance Method Details

#sp_calendar_month(date: nil, **html_options, &block) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/stimulus_plumbers/helpers/calendar_helper.rb', line 6

def sp_calendar_month(date: nil, **html_options, &block)
  if date
    html_options.deep_merge!(
      data: {
        "calendar-month-year-value":  date.year,
        "calendar-month-month-value": date.month - 1,
        "calendar-month-day-value":   date.day
      }
    )
  end
  calendar_renderer.month(**html_options, &block)
end