Merged r4516 from trunk (i18n 0.4.2 gem is now required: 'gem install -v=0.4.2 i18n', see #7013).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4532 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-12-18 13:53:34 +00:00
parent 142b837271
commit fdaf587652
4 changed files with 19 additions and 7 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ module Redmine
def format_date(date)
return nil unless date
Setting.date_format.blank? ? ::I18n.l(date.to_date, :count => date.strftime('%d')) : date.strftime(Setting.date_format)
Setting.date_format.blank? ? ::I18n.l(date.to_date) : 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, :count => local.strftime('%d'), :format => (include_date ? :default : :time)) :
Setting.time_format.blank? ? ::I18n.l(local, :format => (include_date ? :default : :time)) :
((include_date ? "#{format_date(time)} " : "") + "#{local.strftime(Setting.time_format)}")
end