Martin Petrov
Martin Petrov

Reputation: 2643

My custom "distance_of_time_in_words"?

How can I create my own version of "distance_of_time_in_words"? For example I want it to say "today, yestarday, the other day, 5 days ago, last Week... and so on.

Upvotes: 0

Views: 409

Answers (1)

John Beynon
John Beynon

Reputation: 37507

Have a look at the implementation of distance_of_time_in_words in the Rails codebase, that will be a good place to start.

https://github.com/rails/rails/blob/master/actionpack/lib/action_view/helpers/date_helper.rb

Upvotes: 1

Related Questions