Support

Account

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>
     }