Repository navigation
Name the exported PDF after the site and reporting period - #13765
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the PDF export filename generation logic to use localized date ranges and site hosts instead of slugified strings. It moves the getSiteHost utility to a shared location, updates PDFExportOrchestrator and PDFHeader to use the new implementation, and adds comprehensive test coverage. Feedback was provided to add a defensive fallback for Intl.DateTimeFormat.prototype.formatRange to prevent runtime errors in older browsers that do not support this ES2021 API.
|
Size Change: 0 B Total Size: 3.39 MB ℹ️ View Unchanged
|
zutigrm
left a comment
There was a problem hiding this comment.
Thanks @mehidi258 nice work. I left you some comments, let me know what you think
Thanks @zutigrm for the feedbacks, i have addressed all. Passing to you for verify. |
|
Thanks @mehidi, there are some merge conflicts that need ti be resolved |
Summary
Related issue(s):
Relevant technical choices
Intl.DateTimeFormat.prototype.formatRangein the codebase, sopdf-utils.tsadds/// <reference lib="es2021.intl" />—tsconfigtargetses5, which leaves it untyped. All@wordpress/browserslist-configtargets support it.getSiteHostgained an optionalfallbackparameter, so the filename can fall back toreportfor an unparseable URL while the header keeps showing the raw value as before./lose the separators, e.g. zh-CN2026/3/1 – 2026/3/7becomes202631 – 202637.PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist
🤖 Generated with Claude Code