Home › Forums › Add-ons › Repeater Field › How to show repeater fields by compare the current date with the date picker? › Reply To: How to show repeater fields by compare the current date with the date picker?
See my code:
$today = new DateTime( 'today', new DateTimeZone('America/Sao_Paulo') );
$date = new DateTime( get_sub_field('data') );
if( have_rows('niver') ) : while ( have_rows('niver') ) : the_row();
$name = get_sub_field('nome');
$dpto = get_sub_field('departamento');
if($today = $date){
<div class="align-center">
<h4 class="text-bold"><?php echo $name ?></h4>
<p><?php echo $dpto ?></p>
</div>
}
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.