Support

Account

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/