lib/reverse_chronic.rb in reverse_chronic-0.0.1.alpha vs lib/reverse_chronic.rb in reverse_chronic-0.0.1.beta
- old
+ new
@@ -1,5 +1,15 @@
require "reverse_chronic/version"
module ReverseChronic
- # Your code goes here...
+ class << self
+ def humanize(time)
+ if time.to_date == Date.today
+ 'today'
+ elsif Time.now.to_date - 1 == time.to_date
+ 'yesterday'
+ else
+ time.strftime('%A, %b%e, %Y')
+ end
+ end
+ end
end