Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 461 Bytes

File metadata and controls

25 lines (17 loc) · 461 Bytes

fuzzy_time

Extends Ruby's Time class with a new fuzzy method that returns the time in a human-readable format.

Inspired by the FuzzyClock OS X app from Objectpark.

Installation

gem install fuzzy_time

Usage

require 'fuzzy_time'

Time.now.fuzzy
# => "half past three"

Time.local(2013, 1, 1, 5, 46).fuzzy
# => "quarter to six"

Time.local(2013, 1, 1, 9, 0).fuzzy
# => "nine o'clock"