Open
Conversation
Contributor
There was a problem hiding this comment.
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
formatCurrentDateto accept an optionaltimezoneand format “today” in that timezone when provided. - Update
PrintViewfooter rendering to pass the configured timezone intoformatCurrentDate. - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
formatCurrentDatefunction insrc/utils/datetime.jsto accept an optionaltimezoneparameter, formatting the date in the specified timezone if provided.PrintViewinsrc/modules/print/PrintView.jsto use the configured timezone when displaying the "Printed on" date in the footer.Testing enhancements:
test/utils/datetime.test.jsto cover formatting the current date in different timezones and with a fixed clock, ensuring consistent and correct behavior.test/modules/print/PrintView.test.jsto verify the printed date uses the configured timezone.used by tidepool-org/export#77