From b1033943a5db9b3ce20fd50181f2d27f49cb73f3 Mon Sep 17 00:00:00 2001 From: Florian Schmitt Date: Mon, 2 Dec 2024 12:16:30 +0300 Subject: [PATCH] feat date contrainte --- templates/bazar/trajets.tpl.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/templates/bazar/trajets.tpl.html b/templates/bazar/trajets.tpl.html index 6bb6345..6d05b4e 100644 --- a/templates/bazar/trajets.tpl.html +++ b/templates/bazar/trajets.tpl.html @@ -18,9 +18,19 @@ if (count($fiches) > 0) { 'fr' )); $foundFiche = true; - //$date = str_replace(' à 0:00', '', strftime("%A %d %B %Y à %k:%M", strtotime($fiche['date_du_trajet']))); echo '

Trajet du '.$dateFormatted.' par '.$fiche['owner'].'

'."\n"; echo '

Producteur concerné

'."\n"; +if (!empty($fiche['bf_contrainte_date'])) { + $dateTimeObjContrainte = new DateTime($fiche['bf_contrainte_date'], new DateTimeZone('Europe/Paris')); + $dateContrainte = + str_replace(' à 0:00', '', IntlDateFormatter::formatObject( + $dateTimeObjContrainte, + 'eeee d MMMM y à HH:mm', + 'fr' + )); + + echo '
Pour laisser le temps au producteur de préparer les commandes, ce trajet sera fermé le '.$dateContrainte.'.
'; +} echo '

'.$producteur['bf_titre'].'

'; echo '

Produits possibles : '.str_replace(',', ', ', $producteur['checkboxListeProduitsVendusproduits_vendus']).'

';