Class: SimpleCalendar::MonthCalendar

Inherits:
Calendar
  • Object
show all
Defined in:
lib/simple_calendar/month_calendar.rb

Constant Summary

Constants inherited from Calendar

Calendar::PARAM_KEY_BLACKLIST

Instance Attribute Summary

Attributes inherited from Calendar

#options, #view_context

Instance Method Summary collapse

Methods inherited from Calendar

#additional_days, #attribute, #end_attribute, #end_date, #group_events_by_date, #initialize, #locals, #partial_name, #render_in, #sorted_events, #sorted_events_for, #start_date, #start_date_param, #td_classes_for, #tr_classes_for, #url_for_next_view, #url_for_today_view

Constructor Details

This class inherits a constructor from SimpleCalendar::Calendar

Instance Method Details

#date_rangeObject



3
4
5
# File 'lib/simple_calendar/month_calendar.rb', line 3

def date_range
  (start_date.beginning_of_month.beginning_of_week..start_date.end_of_month.end_of_week).to_a
end

#url_for_previous_viewObject



7
8
9
# File 'lib/simple_calendar/month_calendar.rb', line 7

def url_for_previous_view
  view_context.url_for(@params.merge(start_date_param => (date_range.first - 1.day).iso8601))
end