Support

Account

Home Forums Add-ons Repeater Field Date picker excluding past repeater fields Reply To: Date picker excluding past repeater fields

  • Is this a date or a date/time field?

    
    // date field
    if (have_rows('academy_dates')) {
      while (have_rows('academy_dates')) {
       the_row();
       $raw_date = get_sub_field('date', false);
       $today = date('Ymd');
       if ($raw_date < $today) {
         // skip it
         continue;
       }
       // the rest of your code here....
      } // end while
    } // end if
    
    
    // time field
    if (have_rows('academy_dates')) {
      while (have_rows('academy_dates')) {
       the_row();
       $raw_date = date('Ymd', get_sub_field('date', false);)
       $today = date('Ymd');
       if ($raw_date < $today) {
         // skip it
         continue;
       }
       // the rest of your code here....
      } // end while
    } // end if