offre date format fix

This commit is contained in:
Bachir Soussi Chiadmi 2024-04-26 18:37:09 +02:00
parent dec98f68d4
commit 05ff1c3c74
1 changed files with 4 additions and 1 deletions

View File

@ -23,7 +23,10 @@ function erabletheme_preprocess_page(&$variables) {
* Implements hook_preprocess_HOOK() for node.html.twig. * Implements hook_preprocess_HOOK() for node.html.twig.
*/ */
function erabletheme_preprocess_node(&$variables) { 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) { function erabletheme_preprocess_node__view__meetup(&$variables) {
/** @var \Drupal\node\Entity $node */ /** @var \Drupal\node\Entity $node */