diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-26 17:13:52 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-26 17:13:52 +0000 |
commit | 768d67f27bf6804ec52afae7cefc2724ff9af654 (patch) | |
tree | f3a2b0e67979077d9a06e95d56c4a8323d342641 /lib | |
parent | 1781d87477e07b441fe3de19e8aea08b98ea0fe7 (diff) | |
download | redmine-768d67f27bf6804ec52afae7cefc2724ff9af654.tar.gz redmine-768d67f27bf6804ec52afae7cefc2724ff9af654.zip |
Workaround for i18n 0.4.x with the old style syntax. #6428 #5608
This will also silance the whole trace with the deprecation warning.
Contributed by Felix Schäfer
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4183 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/i18n.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/redmine/i18n.rb b/lib/redmine/i18n.rb index 1bfca81e4..e7aac9f7e 100644 --- a/lib/redmine/i18n.rb +++ b/lib/redmine/i18n.rb @@ -37,7 +37,7 @@ module Redmine def format_date(date) return nil unless date - Setting.date_format.blank? ? ::I18n.l(date.to_date) : date.strftime(Setting.date_format) + Setting.date_format.blank? ? ::I18n.l(date.to_date, :count => date.strftime('%d')) : date.strftime(Setting.date_format) end def format_time(time, include_date = true) @@ -45,7 +45,7 @@ module Redmine time = time.to_time if time.is_a?(String) zone = User.current.time_zone local = zone ? time.in_time_zone(zone) : (time.utc? ? time.localtime : time) - Setting.time_format.blank? ? ::I18n.l(local, :format => (include_date ? :default : :time)) : + Setting.time_format.blank? ? ::I18n.l(local, :count => local.strftime('%d'), :format => (include_date ? :default : :time)) : ((include_date ? "#{format_date(time)} " : "") + "#{local.strftime(Setting.time_format)}") end |