From 05ff1c3c740ae1eeda36efaa4cdbd70816cc5f94 Mon Sep 17 00:00:00 2001 From: bach Date: Fri, 26 Apr 2024 18:37:09 +0200 Subject: [PATCH] offre date format fix --- web/themes/erabletheme/erabletheme.theme | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/themes/erabletheme/erabletheme.theme b/web/themes/erabletheme/erabletheme.theme index 1402703..1b5ade0 100644 --- a/web/themes/erabletheme/erabletheme.theme +++ b/web/themes/erabletheme/erabletheme.theme @@ -23,7 +23,10 @@ function erabletheme_preprocess_page(&$variables) { * Implements hook_preprocess_HOOK() for node.html.twig. */ function erabletheme_preprocess_node(&$variables) { - $t = "t"; + $node = $variables['node']; + /** @var Drupal\Core\Datetime\DateFormatterInterface $date_formatter */ + $date_formatter = \Drupal::service('date.formatter'); + $variables['date'] = $date_formatter->format($node->created->value, 'custom', 'j F Y', null, 'fr'); } function erabletheme_preprocess_node__view__meetup(&$variables) { /** @var \Drupal\node\Entity $node */