Skip to content

fix: cp-7.58.0 formatTimeRemaining to correctly display time remaining#21843

Merged
VGR-GIT merged 1 commit into
mainfrom
fix-time-remaining-rewards
Oct 29, 2025
Merged

fix: cp-7.58.0 formatTimeRemaining to correctly display time remaining#21843
VGR-GIT merged 1 commit into
mainfrom
fix-time-remaining-rewards

Conversation

@VGR-GIT

@VGR-GIT VGR-GIT commented Oct 29, 2025

Copy link
Copy Markdown
Contributor

Description

Right now the rewards component that displays the number of time left is incorrectly showing the time left if the hours value returned by getTimeDifferenceFromNow is 0. (it will only show minutes left in this case) This will happen if the end date of the season versus the current time on the app is X day(s) 0 hours and X minute(s).

Changelog

CHANGELOG entry: fix rewards season time remaining

Related issues

Fixes: #21842

Screenshots/Recordings

Before

image

After

image

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Adjust time-remaining formatting to include days/hours/minutes with stricter null conditions and update tests, plus locale checks for rewards date formatting.

  • Utilities:
    • Update formatTimeRemaining to compose output from days, hours, and minutes, trim trailing space, and return null only when all are non-positive.
  • Tests:
    • Revise and expand formatUtils.test.ts for new formatTimeRemaining behavior (e.g., days+minutes, hours-only, minutes-only, large diffs, zero/negative cases, trimming).
    • Add locale-aware checks for formatRewardsDate (default and custom locales).
    • Maintain number formatting fallback test using mocked getIntlNumberFormatter.

Written by Cursor Bugbot for commit a87305a. This will update automatically on new commits. Configure here.

@VGR-GIT VGR-GIT requested a review from a team as a code owner October 29, 2025 09:06
@VGR-GIT VGR-GIT added team-rewards Rewards team regression-RC-7.58.0 Regression bug that was found in release candidate (RC) for release 7.58.0 labels Oct 29, 2025
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Oct 29, 2025
@VGR-GIT VGR-GIT added the regression-prod-7.57.0 Regression bug that was found in production in release 7.57.0 label Oct 29, 2025
jbblanc
jbblanc previously approved these changes Oct 29, 2025
@sonarqubecloud

Copy link
Copy Markdown

@VGR-GIT VGR-GIT added this pull request to the merge queue Oct 29, 2025
Merged via the queue into main with commit e4821b5 Oct 29, 2025
87 checks passed
@VGR-GIT VGR-GIT deleted the fix-time-remaining-rewards branch October 29, 2025 10:16
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 29, 2025
@metamaskbot metamaskbot added the release-7.59.0 Issue or pull request that will be included in release 7.59.0 label Oct 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template regression-prod-7.57.0 Regression bug that was found in production in release 7.57.0 regression-RC-7.58.0 Regression bug that was found in release candidate (RC) for release 7.58.0 release-7.59.0 Issue or pull request that will be included in release 7.59.0 size-M team-rewards Rewards team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Wrong end date displayed for Rewards Season 1

3 participants