Update announcements date format

Created on 26 November 2024, 25 days ago

Problem/Motivation

The announcements feed date includes the time, which isn't very relevant.
Even the listing in drupal.org, which contains all the information, uses only the date:

https://www.drupal.org/about/announcements/blog β†’

Note: this is relevant to Drupal CMS designs.

Steps to reproduce

  1. Install Drupal with Standard
  2. Go to Announcements page, see the full datetime is shown

Proposed resolution

Add a new "Short date only" date format to system module.
Use that in the announcements.html.twig template.
Provide an upgrade path to create the date format.

Remaining tasks

Agreement?

User interface changes

Announcement feed shows only the date, without the time.

API changes

New date format provided.

Data model changes

None.

Release notes snippet

None?

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

announcements_feed.module

Created by

πŸ‡ͺπŸ‡ΈSpain penyaskito Seville πŸ’ƒ, Spain πŸ‡ͺπŸ‡Έ, UTC+2 πŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @penyaskito
  • πŸ‡ͺπŸ‡ΈSpain penyaskito Seville πŸ’ƒ, Spain πŸ‡ͺπŸ‡Έ, UTC+2 πŸ‡ͺπŸ‡Ί
  • πŸ‡ͺπŸ‡ΈSpain penyaskito Seville πŸ’ƒ, Spain πŸ‡ͺπŸ‡Έ, UTC+2 πŸ‡ͺπŸ‡Ί
  • Pipeline finished with Failed
    25 days ago
    Total: 121s
    #351289
  • Pipeline finished with Failed
    25 days ago
    Total: 876s
    #351290
  • πŸ‡¦πŸ‡ΊAustralia pameeela

    Thanks for progressing this. I'm sure it needs tests :)

    I think the ideal for announcements would be j F Y (this is the format on d.o) which is already Olivero Medium, but we can't use it because Olivero won't necessarily be always installed.

    We could create 'Default medium date only' instead but this would be slightly different from 'Default medium' which uses j M Y which seems a bit confusing. But this could replace Olivero Medium? A can of worms as usual!

  • πŸ‡ΈπŸ‡°Slovakia poker10

    Creating a new format just for this one specific place is a bit weird. When you install Drupal on standard profile, 12 formats are already created. If the time is a problem, cannot we use here the existing html_date format instead and then maybe just change its date representation in Drupal CMS to j F Y?

  • πŸ‡¦πŸ‡ΊAustralia pameeela

    I do agree there are already a lot of formats. But it's not really a Drupal CMS issue, it's just that's how it surfaced. We added a new feature to core for announcements and we don't have an appropriate date format for it, outside of Olivero.

    Of course, there are ways we can override it in Drupal CMS. But I think in this case, what's best for Drupal CMS is best for core. I don't feel that strongly about it either way though.

  • πŸ‡­πŸ‡ΊHungary GΓ‘bor Hojtsy Hungary

    Re changing html_date in Drupal CMS, core's html_date is Y-m-d, which is to be used for HTML output, eg. datetime attributes and input elements for date input. See https://developer.mozilla.org/en-US/docs/Web/HTML/Date_and_time_formats, so I don't think changing that to something user facing is a good idea, browsers may not understand the updated format where it is actually used in the HTML source as intended.

    In general we should stay away from messing with the html_... date formats, they are spec defined :)

    So that leaves us with the long, medium and short date format in core, and all of them contain the time. I agree a date format in core for date only (without time) would be good.

  • πŸ‡­πŸ‡ΊHungary GΓ‘bor Hojtsy Hungary
Production build 0.71.5 2024