Hi guys,
Is it possible to show repeater fields by comparing the current date with the date entered in the date picker field? I need to list the birthday boy of the day. See my fields:
Repeater Field: niver
Sub-Field: name (text)
Sub-Field: department (text)
Sub-field: date (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>
}