Tuesday, September 25, 2007

plugin: relative dates

For relative dates: today, yesterday, etc.

Run


ruby script/plugin install http://ar-code.svn.engineyard.com/plugins/relative_time_helpers/


See this for more details:

<%= relative_time(Time.now) %>
# today
<%= relative_time(1.day.ago) %>
# yesterday
<%= relative_time(1.day.from_now) %>
# tomorrow
<%= relative_time_span([Time.now, 5.days.from_now]) %>
# May 17th - 22nd


I got it from http://activereload.net/

No comments: