module DateHelper
Public Instance Methods
adjust_date(date)
click to toggle source
# File lib/helpers/date_helper.rb, line 6 def adjust_date(date) case date when String date when ::Date, DateTime format_date(date) when Integer format_date(Time.at(date)) end end
current_date()
click to toggle source
# File lib/helpers/date_helper.rb, line 21 def current_date format_date(::Date.current) end
current_year()
click to toggle source
# File lib/helpers/date_helper.rb, line 2 def current_year ::Date.current.year end
format_date(date)
click to toggle source
# File lib/helpers/date_helper.rb, line 17 def format_date(date) date.strftime('%F') end