Created
June 29, 2011 19:59
-
-
Save robbyrussell/1054781 to your computer and use it in GitHub Desktop.
Before I start hacking on this myself... anyone have a Ruby method to produce this?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# return strings like: | |
# "3 months and 14 days" until"... | |
# "1 year and 11 days until"... | |
# | |
def time_until_in_words(future_date) | |
future_date - Date.today | |
# magic! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
dotiw
gem will do this. It overrides the defaultdistance_of_time_in_words
method. http://rubydoc.info/gems/dotiw/1.1.0/frames