summaryrefslogtreecommitdiffstats
path: root/config/initializers/10-patches.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-11-07 09:50:16 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-11-07 09:50:16 +0000
commit86a9d90f07d6a46a733524d6ae5ac79740687154 (patch)
tree5ac75ab7214ddf58bfa257f4cbdfee42afcf91a8 /config/initializers/10-patches.rb
parent668ec7f69421f925160ec1effa3216e4754cc2da (diff)
downloadredmine-86a9d90f07d6a46a733524d6ae5ac79740687154.tar.gz
redmine-86a9d90f07d6a46a733524d6ae5ac79740687154.zip
Fixes distance of date in words calculation.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3016 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config/initializers/10-patches.rb')
-rw-r--r--config/initializers/10-patches.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb
index 94d40faaf..9aa416f55 100644
--- a/config/initializers/10-patches.rb
+++ b/config/initializers/10-patches.rb
@@ -53,9 +53,9 @@ module ActionView
I18n.with_options :locale => options[:locale], :scope => :'datetime.distance_in_words' do |locale|
case distance_in_days
- when 0..60 then locale.t :x_days, :count => distance_in_days
+ when 0..60 then locale.t :x_days, :count => distance_in_days.round
when 61..720 then locale.t :about_x_months, :count => (distance_in_days / 30).round
- else locale.t :over_x_years, :count => (distance_in_days / 365).round
+ else locale.t :over_x_years, :count => (distance_in_days / 365).floor
end
end
end