Support

Account

Home Forums ACF PRO Date Picker comparing two dates Reply To: Date Picker comparing two dates

  • Hi @simow,

    @guinnessboy solution should work just fine.

    Also you may conisdering filtering your posts by date.

    $today = date(“Y-m-d”);
    echo $today;

    $args = array(
    ‘post_type’ => ‘post’,
    ‘posts_per_page’ => -1,
    ‘meta_key’ => ‘event_date’,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => ‘ASC’,
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘event_date’,
    ‘value’ => $today,
    ‘type’ => ‘DATE’,
    ‘compare’ => ‘>’,
    )
    )
    );
    Hope this helps.