Project

General

Profile

Feature #21421 » 0000-Add-optional-user-parameter-to-I18n-format_time-to-o.patch

Jan from Planio www.plan.io, 2015-12-11 12:33

View differences:

lib/redmine/i18n.rb
::I18n.l(date.to_date, options)
end
def format_time(time, include_date = true)
def format_time(time, include_date = true, user = nil)
return nil unless time
options = {}
options[:format] = (Setting.time_format.blank? ? :time : Setting.time_format)
time = time.to_time if time.is_a?(String)
zone = User.current.time_zone
zone = (user || User.current).time_zone
local = zone ? time.in_time_zone(zone) : (time.utc? ? time.localtime : time)
(include_date ? "#{format_date(local)} " : "") + ::I18n.l(local, options)
end
(3-3/9)