#61535 closed defect (bug) (fixed)
human_time_diff(): Do not use abbreviations in minutes
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Formatting | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
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.
9 days ago
#2
- Keywords has-patch has-unit-tests added
Trac ticket: https://core.trac.wordpress.org/ticket/61535
#4
@
9 days ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 58600:
@SergeyBiryukov commented on PR #6942:
9 days ago
#5
Thanks for the PR! Merged in r58600.
#6
follow-up:
↓ 7
@
9 days 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:
Post Date Block: Editor