Skip to content

#535 - Align plan version history dates - #1377

Merged
brijesh-amin merged 4 commits into
devfrom
fix/535-align-plan-version-pdf-dates
Aug 7, 2026
Merged

brijesh-amin merged 4 commits into
devfrom
fix/535-align-plan-version-pdf-dates

Conversation

@brijesh-amin

Copy link
Copy Markdown
Collaborator

Summary

  • format version history submission and approval dates using America/Vancouver
  • replace the implicit browser timezone for this view with explicit Day.js UTC conversion

Verification

  • Frontend typecheck passes
  • Frontend formatting passes
  • Targeted lint passes with existing warnings

The matching API changes are in bcgov/range-api#537.

Closes #1376

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses the one-day mismatch in plan version history timestamps (vs. the downloaded PDF) by formatting submission/approval times in an explicit BC/Pacific timezone rather than the user’s browser timezone.

Changes:

  • Added a new formatPlanVersionDate utility that converts timestamps from UTC to America/Vancouver before formatting.
  • Updated the plan versions dropdown list to use the new formatter instead of moment(...) with implicit browser timezone.

Reviewed changes

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

File Description
src/utils/format/date.ts Introduces Day.js timezone-based formatter (formatPlanVersionDate) for plan version timestamps.
src/components/rangeUsePlanPage/versionsList/VersionsDropdownList.tsx Switches version history date rendering to the new timezone-aware formatter.

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

Comment thread src/utils/format/date.ts Outdated
Comment thread src/utils/format/date.ts Outdated
brijesh-amin and others added 2 commits August 7, 2026 12:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

src/components/rangeUsePlanPage/versionsList/VersionsDropdownList.tsx:57

  • PR description says it “replace[s] the implicit browser timezone for this view”, but this view still renders attachment timestamps via moment(attachment.createdAt) (in src/components/rangeUsePlanPage/versionsList/AttachmentsList.tsx:64), which remains browser-timezone dependent. If the intent is full consistency within the version history dropdown, consider updating AttachmentsList to use the same formatPlanVersionDate/timezone approach as the version rows.
        <TableCell>{formatPlanVersionDate(option.version.createdAt)}</TableCell>
        <TableCell>{option.version.approvedBy}</TableCell>
        <TableCell>{formatPlanVersionDate(option.version.approvedAt)}</TableCell>

Comment thread src/utils/format/planVersionDate.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@brijesh-amin brijesh-amin self-assigned this Aug 7, 2026
@brijesh-amin
brijesh-amin merged commit 6631835 into dev Aug 7, 2026
3 checks passed
@brijesh-amin
brijesh-amin deleted the fix/535-align-plan-version-pdf-dates branch August 7, 2026 19:48
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.

Align plan version history dates with downloaded PDF

2 participants