Problem/Motivation

Some date formats in Drupal core are using the US format, for example the Default medium date for 7th of August:

Wed, 08/07/2024 - 11:24

Steps to reproduce

Open Administration > Configuration > Region and language > Date and time formats (/admin/config/regional/date-time) and see that US date format is used.

Proposed resolution

It would be nice to use a more international and human readable format, such as "7 Aug 2024". This is also used on drupal.org, as can be see in this issue, under "Created: 7 Aug 2024 at 11:24 CEST".

It is also the recommended format here:

Date formats currently

Name Pattern
Default long date Wednesday, August 7, 2024 - 13:55
Default medium date Wed, 08/07/2024 - 13:55
Default short date 08/07/2024 - 13:55
Olivero Medium 7 August, 2024
Fallback date format Wed, 08/07/2024 - 13:55
[...]

Proposed changes to date formats

Name Pattern
Default long date Wednesday, 7 August 2024 - 13:55
Default medium date Wed, 7 Aug 2024 - 13:55
Default short date 7 Aug 2024 - 13:55
Olivero Medium 7 August 2024
Fallback date format Wed, 7 aug 2024 - 13:55
[...]

Remaining tasks

Update the date formats to use an intuitively understandable and international standard:

Wednesday, 7 August 2024 - 13:55

User interface changes

New installs have more international-friendly date formats.

API changes

Data model changes

Translations

Issue fork drupal-3466529

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ressa created an issue. See original summary.

ressa’s picture

Issue summary: View changes
greggles’s picture

+1 to using a more rapidly recognized date conceptually, though i notice that dates on admin/content are a similar format to security review.

Is there a reference page on drupal.org about formatting dates?

ressa’s picture

Title: Use drupal.org date format, not US » Use Date formats in ISO-8601 format
Project: Security Review » Drupal core
Version: 3.0.x-dev » 11.x-dev
Component: User interface » ajax system
Category: Feature request » Bug report
Issue summary: View changes
Related issues: +#11001: Date formats in ISO-8601 format

Thanks for a fast and positive reply @greggles.

Some of Drupal's date formats were actually set to use the ISO-8601 standard in 2004 (Drupal 4.5.0) by Dries, but they must have been lost somewhere along the way ...

Maybe we should update Drupal core instead, and then perhaps it will also fix Security Review's date format? It looks like it might be using a Drupal core date format:

$ grep -iR "Review results from last run" .
./templates/run_and_review.html.twig:    Review results from last run {{ date }}

I have updated the Issue Summary, and moved it to Drupal core instead.

ressa’s picture

Issue summary: View changes
ressa’s picture

And about this:

Is there a reference page on drupal.org about formatting dates?

I am not sure, but it would be great to have one, if only just stating that the date format in the ISO-8601 standard should be followed in Drupal.

ressa’s picture

Component: ajax system » user system
Category: Bug report » Task
Status: Active » Needs review

I tried updating the date formats and tests, maybe some more tests need to be updated? Let's see!

ressa’s picture

Title: Use Date formats in ISO-8601 format » Use rapidly recognizable date format
Issue summary: View changes

Actually, ISO 8601 doesn't cover month names (jan, feb, etc.) so this issue aims at switching to a rapidly recognizable date format, the same as drupal.org issues uses:

Created: 7 Aug 2024 at 11:24 CEST

So updating the title.

smustgrave’s picture

Status: Needs review » Needs work

Was wondering why this ticket looked familiar haha

Will agree with @greggles but MR appears to be failing a few tests.

ressa’s picture

Title: Use rapidly recognizable date format » Use easily recognizable date format
Status: Needs work » Needs review

Yes @smustgrave, I realized that the right method was to update all the dates :-)

And by the way, let me just repeat that I am eternally grateful that you started and lead the Needs Review Queue Initiative initiative. In my opinion, it's among the most important initiatives, together with Drupal Starshot.

ressa’s picture

Issue summary: View changes

Adding "7th of August" in issue summary to clarify why "08/07/2024" can be opaque.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

I appreciate that @ressa!

I checked the MR and changes make sense. Being from the US these formats made sense to me but agree that being more international is a good move.

catch’s picture

This looks great to me and a good sign that Olivero's visitor-facing format doesn't need to change. Could probably use product manager review though so tagging for that.

gábor hojtsy’s picture

https://en.wikipedia.org/wiki/Wikipedia:Overview_of_date_formatting_guid... also lists this format as the first suggested although it does not seem to have hierarchy for formats. I think this is a good improvement, also this is what DrupalCon uses for their date formats. Removing product review tag as a core product manager.

ressa’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs review

Thanks for looking at this @catch and @Gábor Hojtsy.

I noticed that there is no comma in the recommended format on Wikipedia, and found few more sources with the same format. So I updated the MR, and removed the comma. I also updated the Olivero date format, which also had a few extra spaces.

ressa’s picture

I have created the documentation page Date formats under "Coding standards", since I couldn't find a page dedicated to this subject ...

Perhaps someone can review it, and add it to the menu, or place it somewhere else, if it doesn't belong in that section? Thanks!

pameeela’s picture

Status: Needs review » Reviewed & tested by the community

Big +1 from me and agree with removing the comma as done in the latest change.

  • catch committed 5675c905 on 11.x
    Issue #3466529 by ressa, smustgrave, Gábor Hojtsy: Use easily...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x, thanks!

Realised after commit that we didn't have a change record here, so added a quick one.

ressa’s picture

Thanks everyone for fast feedback and roll-out! It's impressive that this improvement went from idea to completion in less than a week, and already see it in effect in lists under "Content" and "Recent log messages", and node edit under "Last saved".

ressa’s picture

ressa’s picture

@greggles:

Is there a reference page on drupal.org about formatting dates?

It doesn't look like there is, so I have created #3467914: Define a standard for Date formats.

smustgrave’s picture

It's impressive that this improvement went from idea to completion in less than a week,

Amazing work!

pfrenssen’s picture

Great improvement, and impressive speed of execution! Thanks all!

mstrelan’s picture

Should this have a change record or release note snippet?

EDIT: Sorry, there is a CR, but probably we should have something in User Interface Changes and Release Note Snippet

acbramley’s picture

This is really funny but this change broke preview_link tests https://git.drupalcode.org/project/preview_link/-/jobs/2449886

Was fun to track down, thanks to @mstrelan for letting me know about this change!

longwave’s picture

Issue summary: View changes
Issue tags: +11.1.0 release highlights

Added the UI changes section, don't think this needs a release note as it only affects new installs but tagged as a highlight in case we want to point it out in a blog post.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ressa’s picture

I just created a related issue.