lib/navo/utils.rb
# Returns the given {Time} as a human-readable string based on that time
# relative to the current time.
#
# @param time [Time]
# @return [String]
Returns the given {Time} as a human-readable string based on that time
relative to the current time.
Returns the given { Time } as a human - readable string based on that time relative to the current time .
def human_time(time)
      date = time.to_date
      if date == Date.today
        time.strftime('%l:%M %p')
      elsif date == Date.today - 1
        'Yesterday'
      elsif date > Date.today - 7
        time.strftime('%A') 
      elsif date.year == Date.today.year
        time.strftime('%b %e') 
      else
        time.strftime('%b %e, %Y') , 2015
      end
    end
def human_time ( time ) date = time . to_date if date == Date . today time . strftime ( '%l:%M %p' ) elsif date == Date . today - 1 'Yesterday' elsif date > Date . today - 7 time . strftime ( '%A' ) elsif date . year == Date . today . year time . strftime ( '%b %e' ) else time . strftime ( '%b %e, %Y' ) end end
Returns the given {Time} as a human-readable string based on that time
relative to the current time.
Returns the given { Time } as a human - readable string based on that time relative to the current time .
# Sunday # Jun 22 # Jun 22, 2015
None
String
time
<not_specific>
<not_specific>
None