CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Block Commenting: Show date or human-readable time diff code #71667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block Commenting: Show date or human-readable time diff code #71667
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. |
There was a problem hiding this 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>
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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 ) ) }
</>
) }

There was a problem hiding this 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.
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
