Class: Time

Inherits:
Object show all
Defined in:
lib/doing/good.rb,
lib/doing/time.rb

Overview

Date helpers

Instance Method Summary collapse

Instance Method Details

#good?Boolean

Tests if object is nil

Returns:

  • (Boolean)

    true if object is defined and has content

#humanize(seconds) ⇒ String

Format seconds as a natural language string

Parameters:

  • seconds (Integer)

    number of seconds

Returns:

  • (String)

    Date formatted as "X days, X hours, X minutes, X seconds"

#relative_dateString

Format time as a relative date. Dates from today get just a time, from the last week get a time and day, from the last year get a month/day/time, and older entries get month/day/year/time

Returns:

#time_agoString

Format date as "X hours ago"

Returns: