Block Commenting: Show date or human-readable time diff code#71667
Block Commenting: Show date or human-readable time diff code#71667t-hamano merged 4 commits intoWordPress:trunkfrom
Conversation
|
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 Unlinked AccountsThe 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. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
t-hamano
left a comment
There was a problem hiding this comment.
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>
packages/editor/src/dataviews/fields/content-preview/content-preview-view.tsx
Show resolved
Hide resolved
4ac23f4 to
117862d
Compare
d1824a9 to
b1da4d8
Compare
|
Hi @t-hamano,
Can you please check |
| <br /> | ||
| { humanTimeDiff( date ? getDate( date ) : currentDate ) } |
There was a problem hiding this comment.
There was a problem hiding this comment.
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 ) ) }
</>
) }
t-hamano
left a comment
There was a problem hiding this comment.
LGTM!
Note: In a follow-up PR, we might be able to try showing the time and time diff on the same line.


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
