Skip to content

Resolve date variables in report headers and footers - #144

Open
shishir-cyber wants to merge 1 commit into
factionsecurity:mainfrom
shishir-cyber:fix/header-footer-date-vars
Open

Resolve date variables in report headers and footers#144
shishir-cyber wants to merge 1 commit into
factionsecurity:mainfrom
shishir-cyber:fix/header-footer-date-vars

Conversation

@shishir-cyber

Copy link
Copy Markdown

replaceHeaderAndFooter previously only received the plain-text replacements map, not the date map used by replacementText for the document body, so ${today}, ${asmtStart}, and ${asmtEnd} were never resolved inside headers/footers. Pass the date map through and run replaceDateVariable against header/footer XML before the existing plain-text replace pass, so both default and custom date formats resolve the same way they already do in the body.
Added DocxHeaderFooterDateTest, covering both the default date format and a custom format (${today MM-dd-yyyy}) in a header, generated through the real DocxUtils.generateDocx(...) path. Full suite passes (973 tests, 0 failures).

Fixes #143

replaceHeaderAndFooter previously only received the plain-text
replacements map, not the date map used by replacementText for the
document body, so ${today}, ${asmtStart}, and ${asmtEnd} were never
resolved inside headers/footers. Pass the date map through and run
replaceDateVariable against header/footer XML before the existing
plain-text replace pass, so both default and custom date formats
resolve the same way they already do in the body.

Fixes factionsecurity#143
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

${today} is not rendered inside headers/footers

1 participant