Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

fix rubocop

Klaus Zanders2737e62c5300
diff --git a/modules/costs/app/models/time_entry.rb b/modules/costs/app/models/time_entry.rb
index 8bbeed8d183..7ca7f424c69 100644
--- a/modules/costs/app/models/time_entry.rb
+++ b/modules/costs/app/models/time_entry.rb
@@ -116,7 +116,7 @@ class TimeEntry < ApplicationRecord
return nil if start_time.blank?
return nil if time_zone.blank?
- ActiveSupport::TimeZone[time_zone].local(spent_on.year, spent_on.month, spent_on.day, start_time / 60, start_time % 60)
+ time_zone_object.local(spent_on.year, spent_on.month, spent_on.day, start_time / 60, start_time % 60)
end
def end_timestamp
@@ -145,4 +145,8 @@ class TimeEntry < ApplicationRecord
def cost_attribute
hours
end
+
+ def time_zone_object
+ ActiveSupport::TimeZone[time_zone]
+ end
end