Class: SimpleCalendar::WeekCalendar
- Inherits:
-
Calendar
- Object
- Calendar
- SimpleCalendar::WeekCalendar
show all
- Defined in:
- lib/simple_calendar/week_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
#initialize, #render, #td_classes_for, #url_for_next_view, #url_for_previous_view
Instance Method Details
#end_week ⇒ Object
12
13
14
|
# File 'lib/simple_calendar/week_calendar.rb', line 12
def end_week
week_number + number_of_weeks - 1
end
|
#number_of_weeks ⇒ Object
8
9
10
|
# File 'lib/simple_calendar/week_calendar.rb', line 8
def number_of_weeks
options.fetch(:number_of_weeks, 1)
end
|
#week_number ⇒ Object
3
4
5
6
|
# File 'lib/simple_calendar/week_calendar.rb', line 3
def week_number
format = (Date.beginning_of_week == :sunday) ? "%U" : "%W"
start_date.beginning_of_week.strftime(format).to_i
end
|