aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorElliot Winkler <elliot.winkler@gmail.com>2012-02-25 16:55:30 -0700
committerElliot Winkler <elliot.winkler@gmail.com>2012-04-30 11:19:49 -0600
commitd2f995eda9df2cc714fe1552604903008ed0baaf (patch)
tree28c4a36b49459cd687009d1fd3f12dd2b940c230 /actionpack/lib
parentc435feb4044f6c62bb188c459c3be5d81cc77b07 (diff)
downloadrails-d2f995eda9df2cc714fe1552604903008ed0baaf.tar.gz
rails-d2f995eda9df2cc714fe1552604903008ed0baaf.tar.bz2
rails-d2f995eda9df2cc714fe1552604903008ed0baaf.zip
distance_of_time_in_words: 45-60 days is about 2 months, not about 1 month
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/date_helper.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index 6ed265a516..79b9ae60a6 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -29,7 +29,8 @@ module ActionView
# 89 mins, 30 secs <-> 23 hrs, 59 mins, 29 secs # => about [2..24] hours
# 23 hrs, 59 mins, 30 secs <-> 41 hrs, 59 mins, 29 secs # => 1 day
# 41 hrs, 59 mins, 30 secs <-> 29 days, 23 hrs, 59 mins, 29 secs # => [2..29] days
- # 29 days, 23 hrs, 59 mins, 30 secs <-> 59 days, 23 hrs, 59 mins, 29 secs # => about 1 month
+ # 29 days, 23 hrs, 59 mins, 30 secs <-> 44 days, 23 hrs, 59 mins, 29 secs # => about 1 month
+ # 44 days, 23 hrs, 59 mins, 30 secs <-> 59 days, 23 hrs, 59 mins, 29 secs # => about 2 months
# 59 days, 23 hrs, 59 mins, 30 secs <-> 1 yr minus 1 sec # => [2..12] months
# 1 yr <-> 1 yr, 3 months # => about 1 year
# 1 yr, 3 months <-> 1 yr, 9 months # => over 1 year
@@ -100,7 +101,7 @@ module ActionView
when 90..1439 then locale.t :about_x_hours, :count => (distance_in_minutes.to_f / 60.0).round
when 1440..2519 then locale.t :x_days, :count => 1
when 2520..43199 then locale.t :x_days, :count => (distance_in_minutes.to_f / 1440.0).round
- when 43200..86399 then locale.t :about_x_months, :count => 1
+ when 43200..86399 then locale.t :about_x_months, :count => (distance_in_minutes.to_f / 43200.0).round
when 86400..525599 then locale.t :x_months, :count => (distance_in_minutes.to_f / 43200.0).round
else
if from_time.acts_like?(:time) && to_time.acts_like?(:time)