Skip to content

Conversation

@theminaldiwan
Copy link
Contributor

Fix #71640

What?
Updated Block Commenting: Show date or human-readable time diff code on board

How?
Adding current date format code and applying style.

After adding code screenshots
Commenting-date-board

@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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @minaldiwan.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Unlinked contributors: minaldiwan.

Co-authored-by: theminaldiwan <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: adamsilverstein <[email protected]>

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

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. Collaborative Workflows Phase 3 of the Gutenberg roadmap around all-things related to collaborative workflows labels Sep 15, 2025
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.

Thanks for the PR!

It seems that this PR doesn't display a human-readable time diff. Can you use the humanTimeDiff instead of dateI18n?

Additionally, the human-readable time diff text should be placed inside the time tag:

<time
	dateTime={ dateI18n(
		'c',
		date ? getDate( date ) : currentDate
	) }
	className="editor-collab-sidebar-panel__user-time"
>
	{ dateI18n(
		dateTimeFormat,
		date ? getDate( date ) : currentDate
	) }
	<br />
	{ humanTimeDiff( date ? getDate( date ) : currentDate ) }
</time>

@theminaldiwan theminaldiwan force-pushed the update-date-code-commenting-board branch from 4ac23f4 to 117862d Compare September 16, 2025 14:22
@theminaldiwan theminaldiwan force-pushed the update-date-code-commenting-board branch from d1824a9 to b1da4d8 Compare September 16, 2025 14:32
@theminaldiwan
Copy link
Contributor Author

Hi @t-hamano,
I updated human-readable time diff code on recent commit.

Screenshot 2025-09-16 at 9 26 40 PM

Can you please check

Comment on lines +73 to +74
<br />
{ humanTimeDiff( date ? getDate( date ) : currentDate ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<br />
{ humanTimeDiff( date ? getDate( date ) : currentDate ) }
{ date && (
<>
<br />
{ humanTimeDiff( getDate( date ) ) }
</>
) }

Sorry, this code seems to produce a weird result on the comment form:

Image

I think the "a second ago" is necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hi @t-hamano
After adding this code no any time like "a second ago" visible on latest open comment form

{ date && (
						<>
							<br />
							{ humanTimeDiff( getDate( date ) ) }
						</>
					) }
Screenshot 2025-09-17 at 8 03 24 PM

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!

Note: In a follow-up PR, we might be able to try showing the time and time diff on the same line.

@t-hamano t-hamano merged commit b965ee8 into WordPress:trunk Sep 18, 2025
74 checks passed
@github-project-automation github-project-automation bot moved this from 🔎 Needs Review to ✅ Done in WordPress 6.9 Editor Tasks Sep 18, 2025
@t-hamano t-hamano changed the title Updated Block Commenting: Show date or human-readable time diff code Block Commenting: Show date or human-readable time diff code Sep 18, 2025
@github-actions github-actions bot added this to the Gutenberg 21.8 milestone Sep 18, 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 [Type] Enhancement A suggestion for improvement.

Projects

Development

Successfully merging this pull request may close these issues.

Block Commenting: Show date or human-readable time diff

4 participants