aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rwxr-xr-xactionpack/lib/action_view/helpers/date_helper.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index 53bba0b217..6b1fbf7268 100755
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -17,6 +17,8 @@ module ActionView
# "about 1 hour". See the source for the complete wording list.
#Set <tt>include_seconds</tt> to true if you want more detailed approximations if distance < 1 minute
def distance_of_time_in_words(from_time, to_time, include_seconds = false)
+ from_time = from_time.to_time
+ to_time = to_time.to_time
distance_in_minutes = ((to_time - from_time) / 60).round.abs
distance_in_seconds = ((to_time - from_time)).round.abs