module Voom::Presenters::Helpers::Time

Constants

LONG_FORMAT
SHORT_FORMAT

Public Instance Methods

format_time(time, format: LONG_FORMAT, timezone: nil) click to toggle source
# File lib/voom/presenters/helpers/time.rb, line 10
def format_time(time, format: LONG_FORMAT, timezone: nil)
  return '' unless time
  time = time.in_time_zone(timezone) if timezone
  time.strftime(format)
end
format_time_long(time, format: nil, timezone: nil) click to toggle source
# File lib/voom/presenters/helpers/time.rb, line 16
def format_time_long(time, format: nil, timezone: nil)
  format_time(time, format: format||LONG_FORMAT, timezone: timezone)
end
format_time_short(time, format: nil, timezone: nil) click to toggle source
# File lib/voom/presenters/helpers/time.rb, line 20
def format_time_short(time, format: nil, timezone: nil)
  format_time(time, format: format||SHORT_FORMAT, timezone: timezone)
end