Class: Backend::BaseHelper::BasicCalendar

Inherits:
SimpleCalendar::MonthCalendar
  • Object
show all
Defined in:
app/helpers/backend/base_helper.rb

Overview

BasicCalendar permits to fix some SimpleCalendar issues with param name and partial.

Instance Method Summary collapse

Instance Method Details

#date_param_nameObject


60
61
62
# File 'app/helpers/backend/base_helper.rb', line 60

def date_param_name
  @options[:param_name] ||= :start_date
end

#partial_nameObject

Overwrite default partial name


56
57
58
# File 'app/helpers/backend/base_helper.rb', line 56

def partial_name
  @options[:partial] || 'backend/shared/month_calendar'
end

#start_dateObject


64
65
66
# File 'app/helpers/backend/base_helper.rb', line 64

def start_date
  view_context.params.fetch(date_param_name, Date.today).to_date
end