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(gantt-pdf): use d.cwyear to not generate invalid dates

as-op28d076bcae84
diff --git a/app/models/work_package/pdf_export/gantt/gantt_builder_weeks.rb b/app/models/work_package/pdf_export/gantt/gantt_builder_weeks.rb
index 9fe3bbf88bc..54ee2e63382 100644
--- a/app/models/work_package/pdf_export/gantt/gantt_builder_weeks.rb
+++ b/app/models/work_package/pdf_export/gantt/gantt_builder_weeks.rb
@@ -30,7 +30,7 @@ module WorkPackage::PDFExport::Gantt
class GanttBuilderWeeks < GanttBuilder
def build_column_dates_range(range)
range
- .map { |d| [d.year, d.cweek] }
+ .map { |d| [d.cwyear, d.cweek] }
.uniq
.map { |year, week| Date.commercial(year, week, 1) }
end