Customize {% created %} private message date

Created on 13 September 2024, 2 months ago
Updated 18 September 2024, 2 months ago

Problem/Motivation

Hello Cyber555,
first of all thank you for this module; I just had something similar in mind for a my project dedicated to a professional users.
I am customizing the different parameters of the windows. One of the things I'll have to do as soon as I set up project in my language (Italian) will be to customize the date.
How can I customize the date format without affecting the module?
Grateful for your kind response

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Active

Version

1.1

Component

Miscellaneous

Created by

🇮🇹Italy senzaesclusiva

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

Comments & Activities

  • Issue created by @senzaesclusiva
  • Hello!
    Thank you for your issue!
    I'll check dates in the module to write it by common Drupal standard.
    Offhand I couldn't even find where I set date format. It seems that I take it as it is...
    And I can create bonus variables of date parts for template overriding.

  • 🇮🇹Italy senzaesclusiva

    Many thanks @cyber555
    I thought too that with {% created%} it was taking the 'Default short date' format from Drupal core. The problem is precisely if you want to use another one :-)
    Thank you for what you can do

  • Hi!
    Check, please, fresh version 1.2.
    Now you can override the template "private-message--windows-inbox.html.twig" in your theme and use it to write any date format:
    {{ created_unixtime|date('Y.m.d H:i') }}

  • 🇮🇹Italy senzaesclusiva

    Hi Cyber555
    many thanks for your effort! It works well and allows to change date format in many use cases.
    Perfect!
    Thanks again

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

Production build 0.71.5 2024