Home › Forums › Add-ons › Repeater Field › Change Date format in Repeater Field › Reply To: Change Date format in Repeater Field
Good morning, John
Thank you very much for your answer, however it seems that my problem is more complicated than it seems…
Because I have to change the first “date” of a line of my repeater only, it is not a single date field.
I tried to modify my code as well to test:
<?php
# Affichage du Mois / Année de la période (1er Element / Date de départ)
if( have_rows('dates') ):
# Recuperation du champs "Dates"
$firstDates = get_field('dates');
# On stop sur le premier item de la période
$first_depart = $firstDates[0]['date_depart'];
// format date
$date1 = date('l d F Y', strtotime($first_depart));
// OR
$date2 = date('F Y', strtotime($first_depart));
echo($date1);
echo($date2);
endif;
?>
Here are some screenshots of my configuration of my dates fields:
I get the date of January 1, 1970
I think there is a problem beyond me.
And the result of the displayed code:
Thank you again for your help !
Bertrand
*************
Edit – Capture (IMG) are not showing…
My Repeateur Field
https://ibb.co/kGaRZw
Date Sub_Field
https://ibb.co/hPOkSG
Display on Website
https://ibb.co/g3Dr1b
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.