Skip to content

[WEB-4267] printed on tz#594

Open
krystophv wants to merge 5 commits intodevelopfrom
WEB-4267-printed-on-tz
Open

[WEB-4267] printed on tz#594
krystophv wants to merge 5 commits intodevelopfrom
WEB-4267-printed-on-tz

Conversation

@krystophv
Copy link
Copy Markdown
Member

@krystophv krystophv commented Feb 9, 2026

WEB-4267
This pull request updates how the printed date is displayed in the print view, ensuring it is shown in the configured timezone rather than always using the browser's local time. It also enhances the related utility function and adds more robust tests for timezone handling.

Timezone handling improvements:

  • Updated the formatCurrentDate function in src/utils/datetime.js to accept an optional timezone parameter, formatting the date in the specified timezone if provided.
  • Modified PrintView in src/modules/print/PrintView.js to use the configured timezone when displaying the "Printed on" date in the footer.

Testing enhancements:

  • Expanded tests in test/utils/datetime.test.js to cover formatting the current date in different timezones and with a fixed clock, ensuring consistent and correct behavior.
  • Updated the print view test in test/modules/print/PrintView.test.js to verify the printed date uses the configured timezone.

used by tidepool-org/export#77

Copilot AI review requested due to automatic review settings February 9, 2026 18:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the “Printed on” date shown in the PDF print footer to respect the configured (patient/report) timezone instead of always using the runtime/browser local timezone, and extends the datetime helper + tests to support that behavior.

Changes:

  • Extend formatCurrentDate to accept an optional timezone and format “today” in that timezone when provided.
  • Update PrintView footer rendering to pass the configured timezone into formatCurrentDate.
  • Add/adjust tests to cover timezone-specific “current date” formatting and verify the print footer uses the configured timezone.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/utils/datetime.js Adds optional timezone support to formatCurrentDate via moment-timezone.
src/modules/print/PrintView.js Uses the configured timezone for the “Printed on” footer date.
test/utils/datetime.test.js Adds fake-timer-based tests validating timezone-specific current-date formatting.
test/modules/print/PrintView.test.js Updates footer assertion to expect the configured-timezone formatted date.
package.json Bumps the app version string for the WEB-4267 workstream.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/utils/datetime.js
Comment thread test/modules/print/PrintView.test.js
clintonium-119
clintonium-119 previously approved these changes Feb 18, 2026
Copy link
Copy Markdown
Member

@clintonium-119 clintonium-119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

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.

3 participants