Days and times plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install http://svn.behindlogic.com/public/rails/plugins/days_and_times/
Example code
>> 1.second => # >> 1.minute => # >> 1.hour => # >> 1.day => # >> 1.week => # >> 1.week - 6.days => # >> 2.days / 2 => # >> 2.weeks / 2.days => 7 >> 1.week * 2 => # >> 1.day * 7 => # >> 1.day.from_now => Tue Aug 07 16:59:28 -0400 2007 >> 1.day.from(Now) => Tue Aug 07 16:58:19 -0400 2007 >> 2.days.from(Yesterday) == Tomorrow => true >> 1.minute.from(Now).until(Tomorrow) => # >> 2.hours.starting(Now) => # >> 2.hours.starting(Now).length / 1.hour => 2 >> 2.hours.starting(Now).end_time => Mon Aug 06 18:58:19 -0400 2007 >> 1.day.starting(1.week.from(Today)) => # >> 1.day.starting(1.week.from(Today)).day_name => "Monday"
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | Back in time (3 older versions) | Last edited by: Guest, 3 months ago

