Module: Eboshi::CalendarHelper
- Defined in:
- app/helpers/eboshi/calendar_helper.rb,
app/helpers/eboshi/calendar_helper.rb
Instance Method Summary collapse
- #calendar(options = {}, &block) ⇒ Object
- #link_to_next_month(date, options = {}) ⇒ Object
- #link_to_previous_month(date, options = {}) ⇒ Object
Instance Method Details
#calendar(options = {}, &block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/helpers/eboshi/calendar_helper.rb', line 5 def calendar( = {}, &block) defaults = { year: Date.today.year, month: Date.today.month, previous_month_text: nil, next_month_text: nil } .reverse_merge! defaults first = Date.civil([:year], [:month], 1) last = first.end_of_month build first, last, , &block end |
#link_to_next_month(date, options = {}) ⇒ Object
69 70 71 |
# File 'app/helpers/eboshi/calendar_helper.rb', line 69 def link_to_next_month(date, = {}) link_to_month(:next, date, ) end |
#link_to_previous_month(date, options = {}) ⇒ Object
65 66 67 |
# File 'app/helpers/eboshi/calendar_helper.rb', line 65 def link_to_previous_month(date, = {}) link_to_month(:prev, date, ) end |