From 0bef53e68d2069731147769c65a2dde731de686a Mon Sep 17 00:00:00 2001 From: deecay Date: Fri, 2 Nov 2018 12:06:59 -0400 Subject: [PATCH] Fix undefined method (#48) --- app/helpers/pivottables_helper.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/helpers/pivottables_helper.rb b/app/helpers/pivottables_helper.rb index fd25fea..c8f1744 100644 --- a/app/helpers/pivottables_helper.rb +++ b/app/helpers/pivottables_helper.rb @@ -8,6 +8,12 @@ def pv_caption(colname) end end + unless defined?(l_hours_short) + def l_hours_short(hours) + "%.2f" % hours.to_f + end + end + def parse_events(events) result_list = Array.new @@ -54,7 +60,7 @@ def parse_issues(issues) strpformat = "" if Setting.date_format == "" - strpformat = lu(User.current, "date.formats.default", :default => "%Y-%m-%d") + strpformat = I18n.t(:"date.formats.default", {:locale => I18n.locale }) else strpformat = Setting.date_format end