Module: YearAfterYear::ViewHelpers

Defined in:
lib/year_after_year/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#current_yearObject

Renders the current year.

Example: 2008


5
6
7
# File 'lib/year_after_year/view_helpers.rb', line 5

def current_year
  Time.now.year
end

#current_year_range(start_year = current_year, separator = '-') ⇒ Object Also known as: year_range



9
10
11
# File 'lib/year_after_year/view_helpers.rb', line 9

def current_year_range( start_year = current_year, separator = '-' )
  [start_year, current_year].sort.uniq.join(separator)
end