Skip to content

Conversation

@USERSATOSHI
Copy link
Contributor

What?

Closes #71650

This PR fixes the displayed comment time in collaboration to show the correct time based on WordPress Installation.

Why?

Earlier, the display time had its timezone offset applied twice ie If WordPress installation is set to UTC and device is set to IST instead of showing the time in UTC, the displayed time was UTC - 530.

How?

This PR addresses this by using getDate function to correctly get the date Object before applying dateI18n at packages/editor/src/components/collab-sidebar/comment-author-info.js#L57-L62

Testing Instructions

  1. Set your computer to AEST (or another positive time zone)
  2. Set your WordPress install to UTC
  3. Edit a post
  4. Start writing a comment on a block, observe the time stamp (it will be the correct UTC time)
  5. Submit the comment, observe the time stamp ( it will be the correct UTC time now )

Screenshots or screencast

Before After

@USERSATOSHI USERSATOSHI changed the title Fix collab comment to display correct time. Fix block comment to display correct time. Sep 15, 2025
@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended Internationalization (i18n) Issues or PRs related to internationalization efforts Collaborative Workflows Phase 3 of the Gutenberg roadmap around all-things related to collaborative workflows labels Sep 15, 2025
@USERSATOSHI USERSATOSHI marked this pull request as ready for review September 15, 2025 07:57
@github-actions
Copy link

github-actions bot commented Sep 15, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: USERSATOSHI <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: peterwilsoncc <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM! This PR works well, and I believe this is the best approach to solve the problem.

@t-hamano t-hamano added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Sep 15, 2025
@github-actions github-actions bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Sep 15, 2025
@t-hamano t-hamano merged commit fa60c72 into WordPress:trunk Sep 15, 2025
83 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.7 milestone Sep 15, 2025
@t-hamano t-hamano added [Feature] Notes Phase 3 of the Gutenberg roadmap around block commenting and removed Collaborative Workflows Phase 3 of the Gutenberg roadmap around all-things related to collaborative workflows labels Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Notes Phase 3 of the Gutenberg roadmap around block commenting Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Block comment time is incorrect

2 participants