Make WordPress Core

Opened 7 months ago

Closed 7 months ago

#63816 closed enhancement (fixed)

Add year to timestamp in revisions comparison interface

Reported by: kgagne's profile kgagne Owned by: sergeybiryukov's profile SergeyBiryukov
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)

current-revision.jpg (191.3 KB) - added by kgagne 7 months ago.
Screenshot of current state of revision comparison w/timestamps

Download all attachments as: .zip

Change History (7)

@kgagne
7 months ago

Screenshot of current state of revision comparison w/timestamps

#1 @iamadisingh
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

@kgagne commented on PR #9442:


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.

#4 @abcd95
7 months ago

Added in [31862]. Also see [24708]

Last edited 7 months ago by abcd95 (previous) (diff)

#5 @SergeyBiryukov
7 months ago

  • Component changed from Editor to Revisions
  • Focuses administration added
  • Milestone changed from Awaiting Review to 6.9
  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

#6 @SergeyBiryukov
7 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 60642:

Revisions: Add year to timestamp in revisions comparison interface.

This aims to make it easier to distinguish between revisions from different years.

Follow-up to [23769], [23898], [24520].

Props kgagne, iamadisingh, abcd95, SergeyBiryukov.
Fixes #63816.

Note: See TracTickets for help on using tickets.