summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/i18n.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/redmine/i18n.rb b/lib/redmine/i18n.rb
index b6998e72c..5d5856746 100644
--- a/lib/redmine/i18n.rb
+++ b/lib/redmine/i18n.rb
@@ -71,8 +71,9 @@ module Redmine
::I18n.l(date.to_date, options)
end
- def format_time(time, include_date=true, user=User.current)
+ def format_time(time, include_date=true, user=nil)
return nil unless time
+ user ||= User.current
options = {}
options[:format] = (Setting.time_format.blank? ? :time : Setting.time_format)
time = time.to_time if time.is_a?(String)