Support

Account

Home Forums General Issues Passing all ACF form data to a React table Reply To: Passing all ACF form data to a React table

  • @john Thanks for trying to help! I know it was a bit of a crazy question. Actually I think I (mostly) solved the problem. It’s kind of a hack because I can’t rely on using something like the WP API to GET my data, but my team agrees it’s ok for now.

    The only issue I’m having at the moment related to this is with the date picker field. I need to display a “Date Completed” column in a table. Right now, if I don’t supply a value, it defaults to Jan 18 2017. So even if there’s nothing in the field (I haven’t selected a date), it’s still acting as if a date was supplied.

    At this point, I don’t know if you’d prefer I switch topics (or open a support ticket) though as this may be a separate/off-topic problem. Thanks again!

    Edit –

    My temporary work around is just a quick check on the status field like this…

    
    if ($request_status !== 'Complete') {
      $formatted_date = ''; // the variable I'm passing to my array.
    } else {
      $date = get_field('date_completed', $post_id);
      $date_completed = new DateTime($date);
      $formatted_date = $date_completed->format('M j Y');
    }
    // continue...