#61535 closed defect (bug) (fixed)
human_time_diff(): Do not use abbreviations in minutes
| Reported by: | wildworks | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.7 |
| Component: | Formatting | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description (last modified by )
I discovered this problem while researching an issue with Gutenberg: https://github.com/WordPress/gutenberg/issues/62976
As I understand it, when relative times are displayed in the block editor, this format is referenced. No abbreviations are used for minutes:
On the other hand, in PHP, i.e. the human_time_diff() function, abbreviations (min/mins) are only used for minutes:
As a result, relative times can be formatted differently depending on whether they're expressed in JS or PHP.
One example is the Post Date block. If the post date is within an hour of the current time and relative format is enabled, it will be displayed as 1 minute/10 minutes in the block editor and represented as 1 min / 10 mins on the frontend.
I suggest not using abbreviations in human_time_diff() functions.
Attachments (2)
Change History (10)
This ticket was mentioned in PR #6942 on WordPress/wordpress-develop by @wildworks.
2 years ago
#2
- Keywords has-patch has-unit-tests added
Trac ticket: https://core.trac.wordpress.org/ticket/61535
@SergeyBiryukov commented on PR #6942:
2 years ago
#5
Thanks for the PR! Merged in r58600.
#6
follow-up:
↓ 7
@
2 years ago
Hi @SergeyBiryukov,
Thank you for the commit.
Looking at r58600, it seems that the singular form is now minutes.
Also, I missed it, but maybe we should remove the abbreviation ((min=minute)) from the comment here as well:
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Post Date Block: Editor