Home › Forums › Add-ons › Repeater Field › Compare dates in rows against today › Reply To: Compare dates in rows against today
I’m very sorry for the time it has taken to respond to your reply.
I’ve used your example with a few changes:
// date starting the week of loaded treasure bag
$treasure_bag_date = get_sub_field('treasure_bag_date', 85);
$last_week = $treasure_bag_date-6;
$next_week = $treasure_bag_date+6;
<tr <?php if( ($treasure_bag_date >= $last_week) && ($treasure_bag_date <= $next_week) ){ echo "id='active_week'"; }?>>
The code is echoing all the weeks.
Here is an example https://www.gymbaroomteliza.com/treasure_bag/
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.