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

Update modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb

Andrej Sandorf8a1715f01d6d
diff --git a/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb b/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb
index b3a6c67f52c..23effda5eb6 100644
--- a/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb
+++ b/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb
@@ -47,9 +47,7 @@ class CostQuery::PDF::TimesheetGenerator
end
def cover_page_dates
- dates_range = all_entries.group_by(&:spent_on).sort
- start_date = dates_range.first&.first
- end_date = dates_range.last&.first
+ start_date, end_date = all_entries.map(&:spent_on).minmax
"#{format_date(start_date)} - #{format_date(end_date)}" if start_date && end_date
end