Skip to content

Conversation

myhro
Copy link
Contributor

@myhro myhro commented Sep 26, 2025

Part of DOTDASH-543.

This PR is related to #105954, but doesn't depend on it.

Proposed Changes

  • Add timezone support to the useFormattedTime hook.
  • Make use of timezones on all backup pages.

Why are these changes being made?

When the DateRangePicker component is fixed, we'll use the site timezone to filter dates. We need to display them in the same timezone to avoid inconsistencies, like an entry being displayed the day before/after the filtering.

This is also in line with the way Jetpack Cloud handles timezones:

image

Testing Instructions

  • Go to /v2/sites/:slug/backups
  • Check the dates for backup list, details and download/restore pages.
  • Confirm they match the dates in Jetpack Cloud.
Before After
image image

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

Copy link

github-actions bot commented Sep 26, 2025

@myhro myhro marked this pull request as ready for review September 26, 2025 01:47
@myhro myhro requested a review from a team as a code owner September 26, 2025 01:47
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 26, 2025
@myhro myhro requested a review from Initsogar September 26, 2025 01:47
Copy link
Contributor

@Initsogar Initsogar left a comment

Choose a reason for hiding this comment

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

I ran some tests, and it works as expected 👍🏽

Since this affects the useFormattedTime hook, I’d love to hear @Automattic/lego’s thoughts as well.

Copy link
Contributor

@fushar fushar left a comment

Choose a reason for hiding this comment

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

Since this affects the useFormattedTime hook, I’d love to hear @Automattic/lego’s thoughts as well.

I think it will be beneficial for everyone to add tests to the useFormattedTime() hook. I got lost reading the changes 😂

@myhro
Copy link
Contributor Author

myhro commented Sep 26, 2025

I think it will be beneficial for everyone to add tests to the useFormattedTime() hook. I got lost reading the changes 😂

Tests were added and can be run with:

 $ yarn test-client client/dashboard/components/formatted-time/test/index.tsx

Can you please check again?

@myhro myhro requested a review from fushar September 26, 2025 15:54
@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • help-center
  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/backups-site-timezone on your sandbox.

@myhro
Copy link
Contributor Author

myhro commented Sep 29, 2025

@fushar Hi. This is a gentle ping in case you missed the last week one. Can you please review this PR?

Copy link
Contributor

@fushar fushar left a comment

Choose a reason for hiding this comment

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

Thanks for the ping. Tests are nice. Thanks!

@myhro myhro merged commit 9ea6349 into trunk Sep 29, 2025
12 checks passed
@myhro myhro deleted the add/backups-site-timezone branch September 29, 2025 14:01
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 29, 2025
@myhro myhro mentioned this pull request Sep 30, 2025
9 tasks
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.

4 participants