Add date formats without time

Created on 11 January 2025, 3 months ago

Problem/Motivation

📌 Update announcements date format Active showed a need for a shorter date format, without time. Several users agreed that it would be nice to offer this:

I agree a date format in core for date only (without time) would be good.

Steps to reproduce

Open Administration > Configuration > Region and language > Date and time formats (/admin/config/regional/date-time) and see that all human readable date formats include time.

Proposed resolution

It would be nice to offer human readable date formats, without time:

Remaining tasks

Add the three date formats above.

User interface changes

New installs now offer shorter human readable date formats, without time.

API changes

Data model changes

Translations

📌 Task
Status

Active

Version

11.0 🔥

Component

user system

Created by

🇩🇰Denmark ressa Copenhagen

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

Merge Requests

Comments & Activities

  • Issue created by @ressa
  • 🇩🇰Denmark ressa Copenhagen
  • 🇩🇰Denmark ressa Copenhagen
  • 🇩🇰Denmark ressa Copenhagen

    Update formats in Issue Summary.

  • Merge request !10875Add three timeless date formats → (Open) created by ressa
  • Pipeline finished with Failed
    3 months ago
    Total: 2225s
    #393151
  • Pipeline finished with Success
    3 months ago
    Total: 1085s
    #393175
  • 🇩🇰Denmark ressa Copenhagen
  • 🇩🇰Denmark ressa Copenhagen
  • 🇺🇸United States smustgrave

    Going to have and look at this later. Not sure why migration test had to be updated

  • 🇩🇰Denmark ressa Copenhagen

    Thanks for looking at this so fast.

    It's the function below. And since there are three more date formats, the date_format count increases from 12 to 15:

      /**
       * {@inheritdoc}
       */
      protected function getEntityCounts(): array {
        return [
          'block' => 37,
          'block_content' => 2,
          'block_content_type' => 1,
    [...]
          'date_format' => 15,
          'entity_form_display' => 23,
          'entity_form_mode' => 1,
          'entity_view_display' => 33,
          'entity_view_mode' => 11,
          'base_field_override' => 2,
        ];
      }
    

    In:

    • /core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php
    • /core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php
  • 🇺🇸United States smustgrave

    Seems like a fine addition and no objection. I didn't see any recipe that was installing datetime formats

    Also doesn't feel like something that would need test coverage as just offering more options.

  • 🇩🇰Denmark ressa Copenhagen

    At the risk of repeating myself, the Needs Review Queue Initiative is among the best things to happen to Drupal the last few years, and the community can't be grateful enough, so thank you @smustgrave!

  • 🇬🇧United Kingdom catch

    Very minor but I'm wondering if these could be e.g. 'Medium date (without time)', rather than starting with 'no time'.

    Since this is user-facing tagging for product manager review.

  • Pipeline finished with Canceled
    2 months ago
    Total: 163s
    #426502
  • 🇩🇰Denmark ressa Copenhagen

    Thanks @catch, great suggestion and I updated the id's and labels. Perhaps you can review and check if "Needs Review" by product manager is still the case?

  • Pipeline finished with Success
    2 months ago
    Total: 381s
    #426506
  • 🇩🇰Denmark ressa Copenhagen

    Update format names in Issue Summary.

  • 🇬🇧United Kingdom catch

    @ressa yes it changes out of the box behaviour so I think it could use it.

  • 🇩🇰Denmark ressa Copenhagen

    Sorry if it wasn't clear, I just meant that if it still looks good to you after my update, then you should feel free to change status to Needs Review :)

  • Status changed to Needs review 17 days ago
  • 🇫🇮Finland lauriii Finland

    Seems fine from product perspective. I've wondered several times myself why we don't have these out of the box 🥲

  • 🇺🇸United States smustgrave

    Thank you @lauriii!

Production build 0.71.5 2024