Getting the created field in long date format

Created on 31 July 2024, 4 months ago

I am currently using the following to get the date an entity was created:
{{ drupal_field('created', 'node', nid) }}

It returns the date in medium date format. How do I get it in long date format? The following still returns a medium date
{{ drupal_field('created', 'node', nid, {type: 'long'}) }}

I got: 'Sun, 14/07/2024' (Drupal's default medium date format: D, d/m/Y)
I was expecting: 'Sunday, 14th July 2024' (Drupal's default long date format: l, jS F Y)

I've also tried:
{{ drupal_field('created', 'node', nid, {type: 'custom', date_format: 'l, jS F Y'}) }}

💬 Support request
Status

Closed: works as designed

Version

3.4

Component

Documentation

Created by

🇬🇧United Kingdom matt b

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

Comments & Activities

  • Issue created by @matt b
  • 🇷🇺Russia Chi

    Something like this.

    {{ drupal_field('created', 'node', nid, {settings: {date_format: 'long'}}) }}
    
  • Status changed to Closed: works as designed 4 months ago
  • 🇬🇧United Kingdom matt b

    Thank you @Chi. That did the trick, I'd not noticed it needed to be under 'settings'.

    Really appreciate the quick response!

Production build 0.71.5 2024