Allow users to change comment display date format

Created on 27 November 2017, about 7 years ago
Updated 7 December 2023, about 1 year ago

Problem/Motivation

The date display of a comment cannot be changed in the configuration or GUI of the site, and defaults to the medium date format.

Users who want to change the date format (for example to use the long or short format instead) need to add a preproccess function to the theme file to set another format.
function THEMENAME_preprocess_comment(&$variables) { $comment = $variables['elements']['#comment']; $variables['created'] = format_date($comment->getCreatedTime(), 'FORMAT_MACHINE_NAME'); }

Users without access, knowledge or the confidence to do this on the command line, can only work around this by changing the medium date format to fit their need, and then experience that change over the whole site, where ever that format is currently used.

Proposed resolution

A similar problem exists for nodes, so maybe it's possible to extend the patch done at #1399990: Remove "Display author and date information" in Display Settings in favor of listing Author and Date in Manage Displays here as well.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

10.1

Component
Comment 

Last updated 8 days ago

Created by

🇳🇱Netherlands ifrik

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India vivek.kekare

    Any update on this please ?

  • Status changed to Needs review 11 months ago
  • 🇺🇸United States cedewey Denver, CO

    I think this is now working. You can change the date format displayed on a comment by doing the following:

    1. Visit the Manage display form of the Comment view mode that displays the comment (eg: Full Content)
    2. Click the gear icon next to the Created field.
    3. Change the date format to the one of your choosing.
    4. Save the Manage display form.


  • Status changed to Postponed: needs info 11 months ago
  • 🇺🇸United States smustgrave

    @ifrik or @vivek.kekare that answer the question?

  • 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦

    @cedewey what is the path of the "Manage display" page that is shown in the screenshot in comment #15?

Production build 0.71.5 2024