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

convert time in modal to the current timezone of the logged user

Klaus Zanders4f03fe005a0d
diff --git a/modules/costs/app/components/time_entries/days_and_hours_form.rb b/modules/costs/app/components/time_entries/days_and_hours_form.rb
index 57a643f304c..bd603f02f04 100644
--- a/modules/costs/app/components/time_entries/days_and_hours_form.rb
+++ b/modules/costs/app/components/time_entries/days_and_hours_form.rb
@@ -83,21 +83,13 @@ module TimeEntries
def start_time_in_local_time
return if model.start_timestamp.blank?
- if model.user == User.current
- model.start_timestamp.in_time_zone(User.current.time_zone)
- else
- model.start_timestamp
- end.strftime("%H:%M")
+ model.start_timestamp.in_time_zone(model.user.time_zone).strftime("%H:%M")
end
def end_time_in_local_time
return if model.end_timestamp.blank?
- if model.user == User.current
- model.end_timestamp.in_time_zone(User.current.time_zone)
- else
- model.end_timestamp
- end.strftime("%H:%M")
+ model.end_timestamp.in_time_zone(model.user.time_zone).strftime("%H:%M")
end
def show_start_and_end_time_fields?