Opened 7 months ago
Closed 7 months ago
#63816 closed enhancement (fixed)
Add year to timestamp in revisions comparison interface
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | trivial | Version: | 6.8.2 |
| Component: | Revisions | Keywords: | 2nd-opinion has-patch |
| Focuses: | ui, administration | Cc: |
Description
## What problem does this address?
The block editor's "Compare Revisions" interface omits the year:
3 years ago (26 Jul @ 11:16) 3 years ago (19 Aug @ 17:10)
As of this moment, one of those dates is more than three years ago; another is less than three years ago. While one might safely infer both revisions were made in 2022, I don't see any harm in including the specific year in the timestamp.
## What is your proposed solution?
Let's add the year to those timestamps:
3 years ago (26 Jul 2022 @ 11:16) 3 years ago (19 Aug 2022 @ 17:10)
Attachments (1)
Change History (7)
#1
@
7 months ago
The issue exists in wp_prepare_revisions_for_js(), the dateShort format uses j M @ H:i which excludes the year. Changing the format to 'j M, Y @ H:i' to include the year this would change "26 Jul @ 11:16" to "26 Jul, 2022 @ 11:16"
This ticket was mentioned in PR #9442 on WordPress/wordpress-develop by @iamadisingh.
7 months ago
#2
- Keywords has-patch added; needs-patch removed
This PR adds the year to revision timestamps in the "Compare Revisions" interface. The revision comparison interface currently shows dates like "26 Jul @ 11:16" without the year, making it difficult to distinguish between revisions from different years.
Updated the dateShort format in wp_prepare_revisions_for_js() to include the year:
- Before: 'j M @ H:i' → "26 Jul @ 11:16"
- After: 'j M, Y @ H:i' → "26 Jul, 2022 @ 11:16"
Trac ticket: https://core.trac.wordpress.org/ticket/63816
7 months ago
#3
Thank you for the swift action on this ticket!
If we're going to stick with the j M Y arrangement (which I recommend!), then I suggest omitting the comma that this PR adds.
Screenshot of current state of revision comparison w/timestamps